hi friends I have got a couple of questions on transactions. 1. I read that CMP entity beans cannot support bean managed transactions. Does it mean that BMP entity beans can support BMT ? Why not ? 2. Does EJB support two-phase commit ? Is there any configuration needed for it ? 3. I know that EJB2.0 Containers support JTA. Do they support JTS also ? I understand that JTS is an implementation which uses JTA API ? Thanks in advance Vipin [ November 25, 2003: Message edited by: Vipin Mohan ]
1. I read that CMP entity beans cannot support bean managed transactions. Does it mean that BMP entity beans can support BMT ? Why not ?
Specification says that any (CMP, BMP) Entity bean MUST use CMT. Ant this makes sense: suppose you are creating bean, forgot to use transaction API in INSERT statement, inserting data in some tables. In one table you successfully inserted, in other table - exception. Rollback dies not happend. It could be a mess.... Also, once you use CMT, don't try to access transaction via DB Connection (resourse). It's prohibited.
2. Does EJB support two-phase commit ? Is there any configuration needed for it ?
EJB container supports tw0-phase commits. It uses this technique for updating data from several DBs in one transaction. There is no need to configure it. The advantage of EJB technology that it makes a lot of programming stuff for you behind the scene. And you don't need to worry about details, while concentrating on business logics writing.
3. I know that EJB2.0 Containers support JTA. Do they support JTS also ? I understand that JTS is an implementation which uses JTA API ?
Let's read specification:
17.1.3 Relationship to JTA and JTS The Java™Transaction API (JTA) is a specification of the interfaces between a transaction manager and the other parties involved in a distributed transaction processing system: the application programs, the resource managers, and the application server. The Java Transaction Service (JTS) API is a Java binding of the CORBA Object Transaction Service (OTS) 1.1 specification. JTS provides transaction interoperability using the standard IIOP protocol for transaction propagation between servers. The JTS API is intended for vendors who implement transaction processing infrastructure for enterprise middleware. For example, an EJB Server vendor may use a JTS implementation as the underlying transaction manager. The EJB architecture does not require the EJB Container to support the JTS interfaces. The EJB architecture requires that the EJB Container support the JTA API defined in and the Connector APIs defined in .
The EJB architecture DOES NOT require the EJB Container to support the JTS interfaces. The EJB architecture requires that the EJB Container support the JTA API
That's all what you need to know about JTS for the test. Regards.
Exam 1Z0-810: Upgrade to Java SE 8 Programmer Study Guide and Quiz Exam 1Z0-817: Upgrade OCP Java 6, 7 and 8 to Java SE 11 Developer Study Guide and Quiz
posted 16 years ago
hi Mikalai Thats clear now. Thanks so much Vipin
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Devious Experiments for a Truly Passive Greenhouse!