views:

26

answers:

2

I'm refactoring some code, converting a number of related updates into a single transaction.

This is using JDBC, MySQL, InnoDB.

I believe there is an unwanted COMMIT still happening somewhere in the (rather large and undocumented) library or application code.

What's the easiest way to find out where this is happening?

There must be some sort of implicit commit, because I'm not finding any COMMIT statements.

+1  A: 

Check out this page in the MySQL docs for statements that cause an implicit commit.

Also, since you're using JDBC, make sure autocommit is false, as in

connection.setAutoCommit(false);
Jim Garrison
Looking at the list actually helped, after I found the my.cnf query-log settings.
Alex R
A: 

I am not an expert with mysql, but there should be a possibility to log all executed statements to a file and/or console. This will probably help. If you can debug through code set breakpoints right before the commits you know, and then have a look to the logged statements. Thus you'll probably see if or if not there is a unwanted commit.

RED SOFT ADAIR