Hi,
 
I am sending this mail again as no one has answered my previous mail, I am restating the problem I am facing and also have attached a sample to recreate the problem.
 
I have a stateless session EJB which accesses a DB2 datasource created using the tranql generic connector. This uses the container managed transaction. I am also using the DB2 9.1 universal JDBC drivers. For methods dealing with datasource related operations I have set sessionContext.setRollBackOnly() within the catch block of SQLException.This throws exceptions when there have to be rollbacks at the database level. For example trying to insert a duplicate record throws the following exception:- com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10114][10307] Invalid operation: Explicit COMMIT or ROLLBACK is not allowed when in auto-commit mode. I have created an example to illustrate this and have attached the source with this mail.
 
I think this is something related to Tranql. Is there any way to turn auto commit off? Can anyone please suggest a way around this? I have stuck with this for some time now.
 
Thanks and regards,
 
Vimalan