• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic