DbMaintain / dbmaintain

DEPRECATED: DbMaintain enables automatic roll-out of updates to a relational database
https://dbmaintain.github.io
Apache License 2.0
17 stars 12 forks source link

No rollback (autocommit=true ??) when error occurs during a script execution #26

Open fcamblor opened 6 years ago

fcamblor commented 6 years ago

Hi there !

When I'm facing some errors during a script execution, I'm surprised that my DB is left "as is" at the point where the script failed ... whereas I can see in the code that a rollback should be supposed to happen.

Do you think I have something wrong configured somewhere ? (I looked for autocommit property in dbmaintain-default.properties but didn't found such config)

Looking more precisely on the code, I can see that both endTransactionAndCommit() and endTransactionAndRollback() call a reenableAutoCommit() in the finally{ .. } statement, no matter if autocommit was enabled (or not) at the beginning of the transaction.

Wouldn't it be a bug ?

Kind regards