This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Question on Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Question on Transactions" Watch "Question on Transactions" New topic
Author

Question on Transactions

Pavan Sambare
Greenhorn

Joined: Aug 21, 2006
Posts: 23
Let's say I have an MDB which has BMP and in the onMessage of the MDB, I am calling a method in an Entity Bean with CMP.
Now my question is, since the method of the Entity Bean has been called in context of the user transaction of the MDB, will a new transaction be created by the container for the Entity bean or will it continue with the same User transaction of the MDB?


SCJP 1.4 -- 98%<br />SCWCD 5 -- 97%
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Pavan,
It depends on the settings in your deployment descriptor. For example, if the EJB is set to use RequiresNew, a new transaction will be created. If it uses Required or Supports, the existing transaction will be used.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question on Transactions
 
Similar Threads
MessageDrivenBean - getUserTransaction?
Mock Question
Transaction context
Transaction propagation in EJB
why entity bean cannot manage own transtaction while session beans can do this ?