• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

What is the use of Transaction statement in EJB?


New Member
Dear Friends,

what does the statement <transaction-type> Container </transaction-type> in <ejb-jar> file means ? Please explain clearly .
Re: transaction type in ejb

Dear Nicky,
There are two types of tranctions are provided by the EJB.
1)BMT(Bean Managed Transaction)
In This case as developer we need to write all the transaction realted properties like transactional attributes, Transaction Isolation levels and transaction handlig code inside our bean class. and also bean class should implent UserTransactionInterface.here all the control realted to the transaction is in developer hand so we can easily trace the transaction
2)CMT(Container Managed Transaction)
In this case all the propertis should be mentioned inside ejb-jar.xml.
and also we need to provide the tag<transaction-type>continer</transaction-type>.here the flow of transaction is not in developer hand so it is liltil bit tadious to trace transaction.
For deatils u can go through the belllow link

I hope u this exp will provide u basic understaing between BMT and CMT
For any clarification feel free to write me
For an endeavor bean for container-managed transaction demarcation, the EJB holder sets those limits of the transactions. You could utilize container-managed transactions for any sort about endeavor bean: session, or message-driven. Container-managed transactions improve advancement on account of those endeavor bean code doesn't unequivocally Stamp the transaction’s limits. Those code doesn't incorporate proclamations that start Also conclusion the transaction.