ScriptRunner icon indicating copy to clipboard operation
ScriptRunner copied to clipboard

not rolling back

Open MetaiR opened this issue 8 years ago • 4 comments

hello and thanks for your perfect java class.

I have an application which creates a random name database then create a user and in an exact database(the other one). I used transaction in my codes and used your class between these two queries for fill up new one with some tables which their codes are in an SQL script file.

the problem is when your class gives an error like io exception the codes not rolling back.

MetaiR avatar Dec 27 '16 21:12 MetaiR

I guess you could try to add better exception management.

Anyway I'm not using this class right now (haven't been for ages), and I don't have time to fix it. Sorry.

BenoitDuffez avatar Dec 28 '16 14:12 BenoitDuffez

@BenoitDuffez have any suggest for replacement?

MetaiR avatar Dec 30 '16 15:12 MetaiR

I don't I'm sorry. But I guess you could fix this and submit a PR.

BenoitDuffez avatar Mar 29 '17 20:03 BenoitDuffez

You should know that DDL statements auto-commit by default. So, e.g. you have some CREATE or ALTER statement somewhere in your script, all the transactions committed upto and including the DDL statement are committed by default. So, even if you try to rollback, you cannot rollback beyond this point as any DDL statement implicitly commits. [MYSQL] ref: https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html

Blacky001 avatar Dec 06 '17 04:12 Blacky001