connection.commit() in a javax.transaction.UserTransaction

Hi

Is it possible to do a connection.commit() when the connnection is participating in a transaction.

I have a scenario wherein I am using different connection objects to insert data in different tables . Before inserting I am creating a UserTransaction which i am committing after successful insertion in all the tables. If any insertion fails I am rolling back the entire transaction .

In one connection to a particular table I am inserting CLOB data for which I have to set connection.setAutoCommit(false). After the insertion I am doing connection.commit().

This approach works on SunOneWebServer but it fails on JRunApplication Server . I am getting this error

Cannot commit, Connection is participating in a transaction when i try to do a connection.commit()

Please help. Thanks in advance

[843 byte] By [aonisha] at [2007-11-14]
# 1
you need XA drivers for all JDBC drivers.you need JTA and a TransactionManager.%
duffymoa at 2007-7-9 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

the app server per se has no affect on the persistence layer.

perhaps you had the right drivers available on one but not the other. perhaps the jndi data source setup isn't the same on both.

but if the code's written properly it should run the same regardless of app server.

%

duffymoa at 2007-7-9 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...