• 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

HFE - Page 371!!!

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi folks,
what is the meaning and signficance of question 18? Why are those methods must run in the transaction context of the methods that invoke those methods?
namaste
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Namaste:
The following quotes are found in 10.5.3 of the spec.

The container must invoke this method in the transaction context determined by the transaction
attribute of the business method that triggered the ejbLoad method.


A select method executes in the transaction context determined by the transaction attribute of
the invoking business method.


The container must ensure that the ejbRemove method and database delete operations are
performed in the transaction context determined by the transaction attribute of the invoked
remove method


It is clear from these quotes that ejbLoad, ejbSelect and ejbRemove run in the transaction context of the method that causes their invocation. ejbLoad and ejbSelect are invoked from business methods and ejbRemove is invoked from a remove method.
As for why it is necessary for them to run in the same context, I'm not sure. Can anyone clear this up.
[ December 13, 2003: Message edited by: Keith Rosenfield ]
 
Bartender
Posts: 3908
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Let's think of entity bean as a row in the table,
So, any opeation with data in DB table has to be performed within transaction, otherwise we could loose data consistency.
Cheers
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mikali,
This is right but why is the condition that these ejbLoad,ejbStore,ejbRemove etc method run in the context of calling method transaction, why it cannot run in its own transaction context?.
Regards,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic