Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do transactions work using JDBC driver?

46271Feb 6 2006 — edited Feb 16 2006
Hi, all.

I am confused on why I can not control rollback and commit of a transaction composed of multiple sql statements from my java application. One thing is that I am using iBatis DAOs for handling db connections and iBatis sqlMaps for building my sql commands. As long as I only perform one sql command at a time, it is either committed or rolled back as I would expect.

If I use the startTransaction, commitTransaction and endTransaction methods provided by iBatis, I thought that I was controlling if a sql command commited or rolled back. Instead, each command is being handled as a seperate unit of work instead of part of a transaction. Is this due to how JDBC works?

I have been told that autocommit is turned off by iBatis, when the startTransaction is called and I thought I read in the Oracle documentation that you can turn off autocommit in the JDBC driver. Can anyone tell if this is true?

Any help would be greatly appreciated as this is becoming a major hurdle for us to get our application deployed.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2006
Added on Feb 6 2006
2 comments
1,293 views