This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes About BMT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "About BMT" Watch "About BMT" New topic
Author

About BMT

Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 213
Dear all,
Why BMT is illegal for entity beans?

Thanks a lot
Benson
Nishant Anshul
Ranch Hand

Joined: Sep 10, 2003
Posts: 72
bcz u cant guess when 1 particular brand/implmn of app server is going to call ejbLoad/ejbStore...so ur trnscn boundaries might conflict i mean another 'begin trans' come before actually 'commiting/rollbkg' the first one and things like that...as the seq of calling of methods ejbLoad,ejbStore, <bus method>---is not defined by specs....so bmt is just out of pic for entityB


SCEA-I, BCJP<p>IBM (India)
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 213
Thanks Nishant.
One thing I need to confirm is
1. When the ejbLoad and ejbStore are called?
As I know, ejbLoad and ejbStore are called in three senario :
1. ejbLoad is called during from Pooled state to ready State
2. ejbStore is called during from ready state to Pooled State
3. ejbLoad and ejbStore are called simultaenously when business method is being invoked.
Am I right? If that is the case, why you said we cannot guess when ejbLoad and ejbStore are called by the app. server?
That is the one I don't understand. Please help to clarify.

Thanks
Benson
Nishant Anshul
Ranch Hand

Joined: Sep 10, 2003
Posts: 72
if u talk abt transition between states like pooled, method-ready etc...then the calling of load/store is more or less defined. But when the instance is servicing the client, then calling of load/store bfr/after every bus method call, or bus method->interejb call..etc etc Or during swapping...its difficult to predict for the developer abt the bhvr of cntr. Ur app might very well work on 1 app svr but may not on the other. hope it helps...
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 213
Thanks Nishant.
Why it is difficult to predict? It has been defined that during servicing a client, ejbLoad and ejbStore are called during invoking a business method.
Am I right?
Benson
Nishant Anshul
Ranch Hand

Joined: Sep 10, 2003
Posts: 72
y r u getting in the same loop again and again??...it is assumed that load and store r called before/after every bus.method...but when there r method to method calls in ejb invocations,or external calls to some other processes ..container may decide to persist or synchronise according to the necessity IT FEELS which CAN be diff from the neccesity which a PROGR FEELS and so ur illegal nesting of transactions might happen...so BMT isn't for entityB...i hope i m clear this time ...Is it that i m not able to put it..so u r not getting it...tell me
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Yes, BMT is apply applied to Session beans and not entity beans.
Look at how you could have answered your question simply by looking at the EJB deployment descriptor
http://java.sun.com/dtd/ejb-jar_2_0.dtd
Discription of entity bean is

Discription of session bean is...

Note the difference?
And finally the descriptin for transaction-type attribute is..

There's the answer!!
[ January 15, 2004: Message edited by: Ajith Kallambella ]

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About BMT