File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes associated with a transaction? 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 "associated with a transaction?" Watch "associated with a transaction?" New topic
Author

associated with a transaction?

Simon Ingram
Ranch Hand

Joined: Nov 30, 2003
Posts: 173
Hi ranchers,

True or false?

An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction


The answer is true. I said false because the container usually throws an exception when the user tries to invoke a bean method while the bean is processing another method. See HFEJB page 558 Transaction Scenario 2 and page 559 Client Scenario 3.

Surely if the bean is associated with a transaction it is in an open transaction?

regards
Simon
Vitaliy Geraymovych
Greenhorn

Joined: Jun 15, 2004
Posts: 24
Originally posted by Simon Ingram:
Hi ranchers,

True or false?



The answer is true. I said false because the container usually throws an exception when the user tries to invoke a bean method while the bean is processing another method. See HFEJB page 558 Transaction Scenario 2 and page 559 Client Scenario 3.

Surely if the bean is associated with a transaction it is in an open transaction?

regards
Simon


I was going between true and false for a while.

But here is what I found in the spec. page 253.
"The container invokes this method with an unspecified transaction context.
Note that if the instance state has been updated by a transaction, the container must first invoke the ejbStore() method on the instance before it invokes ejbPassivate() on it."

Vitaliy


SCBCD 1.3<br />SCJP 1.2<br /> <br />"Every time I learn something new, it pushes some old stuff out of my brain" H.Simpson
Sujatha Kumar
Ranch Hand

Joined: Jan 05, 2004
Posts: 134

An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction


When a Bean instance is associated with a trasaction, it
cannot be Passivated


SCJP,SCWCD,SCBCD,SCEA Part I
Vitaliy Geraymovych
Greenhorn

Joined: Jun 15, 2004
Posts: 24
Originally posted by Sujatha Kumar:


When a Bean instance is associated with a trasaction, it
cannot be Passivated


My understanding is that entity bean can be passivated as per spec.
Session bean cannot be passivated.

Vitaliy
 
jQuery in Action, 2nd edition
 
subject: associated with a transaction?