Welcome Guest, Not a member yet? Register   Sign In
Session message disappears if db transaction is enabled - bug?
#7

(01-03-2016, 10:45 AM)Narf Wrote:
(01-03-2016, 10:16 AM)skunkbad Wrote:
(01-03-2016, 04:28 AM)Narf Wrote: "flash" is irrelevant here - this will happen with any type of session data when you use the database driver.

The problem is, when you share the database connection (and that may happen even if you try to avoid it, it's just how PHP works), a transaction started for your own queries will obviously include the session library's queries - you can't avoid that.

And the library can't avoid it either because there are two strategies to take - discard current state of the transaction or commit it unconditionally. Both ways would cause a problem for somebody.

Interesting. So the failed transaction is actually rolling back the session insert/update. I wonder if this would still be true if the sessions table was MyISAM instead of InnoDB.

Since MyISAM doesn't support transactions, that should work around the issue - indeed. The SQL for table creation in the user guide doesn't specify a database engine ... maybe I should add this as a tip, hadn't thought of it before.

In my own testing within the last week, I noticed that creating a table without specifying the database engine left the choice up to MySQL. In one case it created it with InnoDB, and in another case it created it with MyISAM. A tip regarding the database engine would be nice, and perhaps some pros and cons of using one or the other when specifically related to sessions.
Reply


Messages In This Thread
RE: Session message disappears if db transaction is enabled - bug? - by skunkbad - 01-03-2016, 12:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB