PxPlus User Forum

Twitter Twitter Twitter

Author Topic: missing rollback on channel close  (Read 447 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 127
    • View Profile
missing rollback on channel close
« on: November 16, 2018, 07:45:29 AM »
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

  • Staff
  • Diamond Member
  • *****
  • Posts: 266
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: missing rollback on channel close
« Reply #1 on: November 16, 2018, 09:13:29 AM »
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.
Software Developer for PVX Plus Technologies LTD.