aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes question about ejbCreate() and ejbRemove()  in Stateless SB or MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "question about ejbCreate() and ejbRemove()  in Stateless SB or MDB " Watch "question about ejbCreate() and ejbRemove()  in Stateless SB or MDB " New topic
Author

question about ejbCreate() and ejbRemove() in Stateless SB or MDB

Galder Zamarre�o
Greenhorn

Joined: Apr 16, 2004
Posts: 12
I have been looking into the cheat sheets available through JavaRanch and i have a question about them:

They seem to indicate that in BMT Stateless Session beans or Message Driven Beans, Transaction details (via getUserTransaction) are available through ejbCreate() and ejbRemove()

I think that this is wrong, can anyone confirm or deny this?

The reason why i think this is wrong is that bean creation and removal is not dependant on any of the user's action and therefore, does not make sense to be able to delimitate a transaction when you do not even know when it happens.

Thanks for your help


SCJP 1.4<br />SCBCD 1.3<br /> <br /><a href="http://essentialselection.blogspot.com/" target="_blank" rel="nofollow">http://essentialselection.blogspot.com/</a>
M Murthy
Ranch Hand

Joined: Nov 20, 2004
Posts: 33
Hi,


According to the spec. pg 90 Table 3, It clearly states that BMT stateless session beans can call EJBContext.getUserTransaction() in ejbCreate() and ejbRemove() methods, but UserTransaction methods (begin(), commit() etc...)can be called only in the business method from component interface.

Same logic for Message Driven Beans (spec pg. 320 Table 12).

Whereas in case of stateful session beans you can call EJBContext.getUserTransaction() and also methods on UserTransaction in ejbCreate()/ejbRemove()/ejbActivate()/ejbPassivate()/Business Methods

Hope this helps.

[ November 29, 2004: Message edited by: M Murthy ]
[ November 29, 2004: Message edited by: M Murthy ]

Sindhu Murthy<br />SCJP 1.4<br />SCBCD
Galder Zamarre�o
Greenhorn

Joined: Apr 16, 2004
Posts: 12
i understand it now. that's a very shuttle difference isn't it? that can really confuse you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about ejbCreate() and ejbRemove() in Stateless SB or MDB