ScriptRunner
ScriptRunner copied to clipboard
not rolling back
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.
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 have any suggest for replacement?
I don't I'm sorry. But I guess you could fix this and submit a PR.
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