> If you're using a non-persistent connection, PHP will close the
> connection when the script terminates, and the MySQL server will roll
back
> implicitly.  For a non-persistent connection, the connection remains
open
> and you may not see the rollback behavior your expect.

I thought this was fixable now. A while back Monty said that changing
users on a connection would reset the connection automatically. He was
talking about the next version (which was several versions back of the 4
series). Resetting the connection (according to this theory) would set
all the per connection variables to their default and rollback any
non-committed transactions. 

My PHP Mysql extension is a bit hacked up (and I have more to do!), so I
can't remember the default now. But I think it should add a 'change
user' command when the page ends on any persistent connection. Change to
a blank user. So in theory then, web pages would be safe for
transactions.

A really ugly hack (assuming a Mysql server version as described above)
would be (in PHP) to connect persistently to mysql then change the user
to a dummy, and then change the user to the one you want again. Doing
this at the start of every page should then make it transaction safe.

Can someone from MySQL confirm that changing users will reset the
connection and rollback unfinished transactions? And starting in what
version?

-steve-



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to