wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Session Bean TX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Session Bean TX" Watch "Session Bean TX" New topic
Author

Session Bean TX

Manish Katyan
Greenhorn

Joined: Apr 19, 2005
Posts: 10
For stateful Session Bean
- You can access resource manager, other beans from ejbCreate(), ejbRemove(), ejbActivate(), ejbPassivate()
- Methods ejbCreate(), ejbRemove(), ejbActivate(), ejbPassivate() runs in 'unspecified transaction context'

Now tell me, how can you access other beans / resource managers from 'unspecified transacrtion context' - i think they can be accessed only from transactional context.

Am i missing something? Please give your input.


Thanks.

Katyan.
David McDonagh
Greenhorn

Joined: Feb 13, 2004
Posts: 19
Here is what the specs mention on this subject P364

====================================================================
The EJB specification does not prescribe how the Container should manage the execution of a method with an unspecified transaction context´┐Żthe transaction semantics are left to the Container implementation.
====================================================================

so to answer your question accessing other beans / resource managers is left solely to the implementation of the container. The specs give some examples of possible solutions .......

=====================================================================
->The Container may execute the method and access the underlying resource managers without a transaction context.
->The Container may treat each call of an instance to a resource manager as a single transaction (e.g. the Container may set the auto-commit option on a JDBC connection).
->The Container may merge multiple calls of an instance to a resource manager into a single transaction.
->The Container may merge multiple calls of an instance to multiple resource managers into a single transaction.
->If an instance invokes methods on other enterprise beans, and the invoked methods are also designated to run with an unspecified transaction context, the Container may merge the resource manager calls from the multiple instances into a single transaction.
->Any combination of the above.
=====================================================================

I hope this helps !!
Manish Katyan
Greenhorn

Joined: Apr 19, 2005
Posts: 10
Thanks for your reply, David.

Sometimes it really gets confusing.
 
wood burning stoves
 
subject: Session Bean TX
 
Similar Threads
stateful CMT, calls from ejbCreate
Doubt about transaction context in statefull session Bean
questions?
Session bean ejbCreate method
(With wonderful replies) what decides access to Resource manager/Enterprise bean?