• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Galder Zamarre´┐Żo
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i understand it now. that's a very shuttle difference isn't it? that can really confuse you.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic