• Post Reply Bookmark Topic Watch Topic
  • New Topic

How JTA Transaction work in the context of EJBs ?  RSS feed

 
bala subramanian
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could any one of explain this
Describe how JTA transactions work in the context of EJBs and the application server in which they are deployed
Thanks in adv,
Bala balas@lucid.co.in
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTA transactions are synonymous with bean managed transaction. First you specify in the deployment descriptor that the transactions will be managed by the beans(EJB impl). Then in the implementation, you will use JTA specific calls to create a transaction context, begin the transaction, and finally commit or rollback as the case may be. The important thing to remember is, you are in control of transaction boundaries and you decide when to commit and rollback. Container is not responsible for( and will not ) manipulate your transaction.
By the way, BMTs are inherently error prone and should be implemented only when inevitable. It is best to let the container manage all transactions( using JTS ) because it is not only easy, but more maintainable since you will not have transaction-specific semantics intermingled with business logic code.
Cheers,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!