• 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

ejbCreate - EntityBean

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I was reading Head First EJB and I really don�t understand why is it possible "force a transaction to rollback" or "find out if the transaction has already been set to rollback" in ejbCreate method for EntityBean?
I thought that I don't even to be able to get EJBObject, the "bodyguard". How is it possible for the container to provide transaction services, if ejbCreate is not in a tx context?
Thanks!
Fernando
SCJP, SCWCD
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The container calls ejbCreate() in the transaction context of the client's create(). If the client calls with a transaction context, then it's perfectly legal to invoke the EJBContext's getRollbackOnly() and setRollbackOnly() methods.
 
Fernando Faria
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Roger for your reply
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
----------------------------------------------------------------------------I was reading Head First EJB and I really don�t understand why is it possible "force a transaction to rollback" or "find out if the transaction has already been set to rollback" in ejbCreate method for EntityBean?
I thought that I don't even to be able to get EJBObject, the "bodyguard".
----------------------------------------------------------------------------------------------
Client calls create() method to create a new row in the D.B. So obviously it is tied to the EJBObject.We can call other methods using that EJBObject.
 
reply
    Bookmark Topic Watch Topic
  • New Topic