Hello all
I'm suffering a strange behaviour using transactions. The enviroment is:
Java 1.3.1 (not under my control)JDBC driver: IBM provided for connecting to DB2 in a AS/400 Using struts with autocommit = false. Problem:
The database state is inconsistent with the fact that a rollback was made. The code structure is more or less this... (not real code, just the skeleton)
The points before every "point" include some information.
The case is that the log
string -written after the finally block- shows the following flow:
...point 1 - General Error - beginning rollback - ...point 2 - ...point 3 - SQLError in finally
and just one second later
...point 1 - General Error - beginning rollback - ...point 2 - ...point 3 - SQLError in finally - begging commit - finishing commit
And I wonder what's happening here? The program flow goes inside the catch clause, begin the rollback, GO BACK inside the try clause, never reach the line with the text " finishing rollback " - I figure out just because the second exception arise - and then, ONE SECOND LATER, do the very same trip with the addition that it makes the commit !?
I have two different occurences of this.
Final note: if you're wondering about the logging mechanism I only can say that it wasn't my fault. The boss just ask me to explain it, no more.
Perhaps this doesn't have anything to do with JDBC transactions or stuff like that, and more with a poorly java implementation. Right now I'm confused. If anybody has any idea about where could the problem be, I will be very grateful.
Thanks for your time
Santi