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
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Session Bean TX" Watch "Session Bean TX" New topic

Session Bean TX

Manish Katyan

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.


David McDonagh

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

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

Sometimes it really gets confusing.
I agree. Here's the link: http://aspose.com/file-tools
subject: Session Bean TX
It's not a secret anymore!