aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes ejbCreate -permitted and prohibited operations - Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "ejbCreate -permitted and prohibited operations -" Watch "ejbCreate -permitted and prohibited operations -" New topic
Author

ejbCreate -permitted and prohibited operations -

marcus don
Ranch Hand

Joined: Jan 26, 2005
Posts: 38
Hi all,
... about permitted and prohibited operations in an ejbCreate
method for a stateful session bean and a stateless session bean.




1) Why I can't mark the current transaction to roll back ?
2) Why I can't Determine whether the transaction has already been marked for rollback?
3) Why I can get a reference to the transaction? (no for stateless)

Thanks
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Why I can't mark the current transaction to roll back ?

ejbCreate never runs in the context of a transaction, so there is nothing to mark for rollback.

Why I can't Determine whether the transaction has already been marked for rollback?

Same reason as above.

Why I can get a reference to the transaction? (no for stateless)

A BMT stateful session bean demarcates its transaction boundaries, and is allowed to do this from ejbCreate. For CMT beans, demarcation is started from the business methods.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
marcus don
Ranch Hand

Joined: Jan 26, 2005
Posts: 38
Hi Roger, may you please explain me the meaning of

A BMT stateful session bean demarcates its transaction boundaries
even with an example Thanks!
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
The following is not tested code (I've written it here in as hurry), but it does give an indication of how you can do this.
marcus don
Ranch Hand

Joined: Jan 26, 2005
Posts: 38
Thank you !
 
 
subject: ejbCreate -permitted and prohibited operations -
 
Similar Threads
Is Specification not reasonable on this point?
getUserTransaction
confusion on ejbCreate
Operations permitted during bean creation
Doubts in CMT vs BMT beans