Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setAutoCommit - URGENT.....  RSS feed

 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

-Ade Barkah
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!