When we make use of container managed transaction - can setAutoCommit() be used from with in the application or is it the task of the container to take care of it ? The following is the extract of xml file <assembly-descriptor> <container-transaction> <method> <ejb-name>abcd</ejb-name> <method-intf>Remote</method-intf> <method-name>*</method-name> </method> <trans-attribute>Supports</trans-attribute> </container-transaction> </assembly-descriptor>
To add to the above, what if methods such as setAutoCommit are prohibited by J2EE spec. for container managed transaction,wont the server respond by throwing an error ?
You may NOT call setAutoCommit() with container managed transaction. You do need to use an appropriate (transaction-aware) data source, ie. one that defaults to autoCommit == false.
Just to add on - agree to what has been said - setAutoCommit cannot be used with Container managed transaction as per J2EE spec. In that case how come a J2EE certified server, BEA 8.1, doesnt throw any exception /error when the transaction setting in the bean was container managed and the application was using setAutoCommit - the application has been working absolutely fine for more than a year. Await a reply...
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
Gift giving made easy with the permaculture playing cards