Originally posted by Alana Sparx:
Thank you Ulf / �dne for your replies. Sorry to drag this topic up again.
If I go down the route of using the transaction capabilities of JDBC:
setAutoCommit(false)
commit()
rollback()
is it also true that I'll need to set the session bean's transaction-type to 'Bean', not 'Container'. This seeems to be the case from the testing I have done (if the bean is set to 'Container', I'm finding that SQL statements are persisted to the database regardless of the setAutoCommit() value and that rollback() has no effect).
If I am correct, why would this be so?
Many thanx
For bean /container managed transaction it is illegal to set autoAutoCommit(false).
What is the tranaction attribute set for the method?
The Bean Provider uses the UserTransaction interface to demarcate transactions. All updates to
the resource managers between the UserTransaction.begin and UserTransaction.commit
methods are performed in a transaction. While an instance is in a transaction, the instance must not
attempt to use the resource-manager specific transaction demarcation API (e.g. it must not invoke the
commit or rollback method on the java.sql.Connection interface or on the
javax.jms.Session interface).
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |