Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transactions Questions

 
Vipin Mohan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 .

Once again:

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.
 
Vipin Mohan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mikalai
Thats clear now.
Thanks so much
Vipin
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!