Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in Bean Managed Transaction..?  RSS feed

 
Karan V Praba
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
Could any one explain, Why we should not invoke resource-manager specific transaction methods(commit or rollback from java.sql.Connection) while TRANSACTION is Bean Managed ..?
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because such an attempt would interfere with the coordination provided by the transaction manager. Even though bean-managed demarcation makes you responsible for starting and completing a transaction, the container still handles the enlistment of resources in a transaction. Therefore, do not use any API provided by a resource manager. For example, if you are accessing a database or a JMS session, you cannot call commit or rollback on a java.sql.Connection or a javax.jms.Session.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!