This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can be passivated when the bean instance is associated with a transaction?

 
vijay Mamilla
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An entity bean instance with container-managed persistence can be passivated when the bean instance is associated with a transaction.
Is it true?

Thanks,
Vijay
 
David McDonagh
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer is false. Beans only get passivate before the instance becomes disassociated with a specific EJB object. Therefore ejbPassivate() executes in an unspecified transaction context.
 
Vijay Dasari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
According to Spec :-
The container can choose to passivate an entity bean within a transaction.
Before passivating it calls
1. ejbStore() ( which will be called within a transactional context)
2. ejbPassivate() ( this action does not really need a transactional context)

Where as a Stateful session bean will never be passivated within a transaction.

Vijay.
 
vijay Mamilla
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Vijay ...Thanks Vijay
 
David McDonagh
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya Vijay is correct ..... from the spec P208 "10.9.3 Passivating and activating" the interaction diagram clearly shows that cmp can be passivated after ejbStore() is called.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!