• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

stateful session bean question from head first

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i am unable to understand the following ingo from Head First book
page 196

In stateful session beans
why does ejb activate, ejbremove, ejbpassivate, ejbcreate cannot do cmt(container managed transaction) transaction METHODS.
(SessionContext.setRollBackOnly, SessionContext.setRollbackOnly are not allowed)

but why can it do bmt transaction roll backs, (u can get
SessionContext.getUserTransaction().start(),
SessionContext.getUserTransaction().commit(), ... etc is allowed)

CAN U GIVE ME SOME EXAMPLE, THAT WOULD BE GREAT.
THANK YOU FOR YOUR TIME AND I REALLY APPRECIATE IT.

THANKS
SID
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you be more specific and clear in your query...

Thanks,

Regds,
Sagar.
 
Raja Sagar Panamgipalli
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you be more specific and clear in your query...

Thanks,

Regds,
Sagar.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sid,
For a stateful session bean, the ejbCreate() runs inside unspecified transaction context(thats the reason no need to specify transaction attributes for session bean home interface, however its required for Entity bean). When there is no transaction context, there is no use for those 2 methods setRollbackOnly() and getRollbackOnly(). However using BMT, you can start your own transaction using the getUserTransaction() method from SessionContext interface. Hope this helps you.

Thanks
Siraj
 
sid nagol
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi siraj
thanks for ur time.
it did answer my question
hi sagar, thanks for ur time too,
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic