File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes BMT Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "BMT Transactions" Watch "BMT Transactions" New topic
Author

BMT Transactions

Dan T
Ranch Hand

Joined: Jun 15, 2004
Posts: 66
In spec of 17.6.1, it says:

If the client request is not associated with a transaction and the instance is already associated with a transaction T2, the container invokes the instance with the transaction that is associated with the instance (T2). This canse can never happen for a stateless Session Bean or a Message-drive Bean.

Does the following represent the scenerio above?

Client invokes on foo,

foo {
bar()
....
}


bar {
ut.begin()
.....
ut.commit()
}

I dont think it is right. What does transaction associated with instance mean?
Any why only for SB/MDB only?

Thanks.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
This case can never happen with stateless session beans (SLSB) and message-driven beans (MDB) because the specification requires those beans to complete any started transaction at the latest when the method invocation returns. Since SLSB and MDB do not maintain any client-specific state, we have no guarantee that the same bean instance will serve two subsequent invocations from the same client. For this reason, transactions cannot span multiple method calls, and it is thus impossible for them to have ongoing transactions (T2) when they receive a new client request. Does this make sense?


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Dan T
Ranch Hand

Joined: Jun 15, 2004
Posts: 66
Thank you Valentin.
I understand what you said in the last post, but im still unclear about the terminology.

Im unclear the difference between:
instance transaction
the transaction that the method runs in

Does the instance transaction mean whether the method we are about to run have a ut.begin() in it?
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
which does entity bean not support?
CMT or BMT


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Does the instance transaction mean whether the method we are about to run have a ut.begin() in it?
Not necessarly... If the bean uses bean-managed transaction demarcation, then yes. But if the bean uses container-managed transaction demarcation, the transaction will be started transparently by the container whenever some method is invoked (as specified in the deployment descriptor).

which does entity bean not support? CMT or BMT
Entity beans MUST NOT use BMT.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BMT Transactions
 
Similar Threads
SessionSynchronization for stateful CMT beans - reloaded
Mock question 7 page 522 HFEJB
dbt in exceptions + transactions + Session bean (BMT)
BMT not propogated to invoked beans
Should Bean developer throw RemoteException & related stuff