Main Board > Programming

missing rollback on channel close

(1/1)

Thomas Bock:
There seems to be a problem with [mysql] and pending transactions. If a [mysql] channel is closed with a pending transaction, then no rollback is performed. A [odb] channel behaves correctly. Is there an OPT-parameter to correct this?
Sample program attached.

Devon Austen:
A took a quick look at the code that handles a [mysql] channel close and a [odb] channel close and it looks like by design the [mysql] interface will commit and pending transactions when closing the channel. While the [odb] interface just closes the channel.

As this is by design it is possible this behavior was desired and users may be relying on it. The only option we would have is to add a option to allow you to override the default behavior and have it not do a commit before closing the connection. This I believe would mean that the transaction would get rolled back by the mysql driver when closing the connection.

I will put adding this option for [mysql] onto our wish list for consideration. If others would benefit from this feature let us know here and this would make it more likely we do it and help us determine its priority.

Navigation

[0] Message Index

Go to full version