> >Considering the above scenario, will all the method calls > above falls into 1 transaction? No each thread from servlet is different transaction. So in this case with required attribute two different transactions run one after another > >Is rollback possible in this scenario? Yes, its upto you how you handle it. If System exception is thrown, transaction will be rolled back automatically by container in each flow you mentioned. So its upto you if you want to continue to next call > >If the ear is deployed into the same application server, even to > >different container (serlvet deployed to servlet >>>> > container, EJBs deployed to EJB container), are the objects > sharing the same JVM? Cannot say, but its always suggested not to assume such things while coding. Why do you want to know? > >I have read about EJB transactions, but the information that I found > >are mainly for EJB to local/remote EJB kind, is > there any > information > >that you can recommend me to read about transaction > behaviour that relates to EJB to POJO or vice versa? > Pojo calls are equivalent to normal method calls. So in your case it doesn't matter if you use POJOs or not unless you are not doing any thing special like starting some transaction etc. /Ashwani > > > > > > > > > > ________________________________ > > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED] On Behalf Of Karen Low > Sent: Wednesday, August 16, 2006 8:27 AM > To: [email protected] > Subject: EJB Transaction > > > Hi, > > I was trying to find out what will be the transaction like > for the following scenario: > > Imagine a servlet method get invokes and it's a deep request > which does 2 db calls, one is insert, another one is update. > > Action class (Servlet): > ---> Stateless Session Bean (1) ---> POJO ---> > Stateless Session Bean (2) ---> POJO (DAO) ==> DB (insert) > ---> Stateless Session Bean (1) ---> POJO ---> > Stateless Session Bean (2) ---> POJO (DAO) ==> DB (update) > > Legend: > ---> calls a method > ==> DB sql execution > > All EJBs are container managed with transaction attribute set > to "Required". All classes mentioned above are packaged into > one ear and deployed into 1 app server. > > Considering the above scenario, will all the method calls > above falls into 1 transaction? Is rollback possible in this > scenario? Are they consider in the same session? If the ear > is deployed into the same application server, even to > different container (serlvet deployed to servlet container, > EJBs deployed to EJB container), are the objects sharing the > same JVM? > > I have read about EJB transactions, but the information that > I found are mainly for EJB to local/remote EJB kind, is there > any information that you can recommend me to read about > transaction behaviour that relates to EJB to POJO or vice versa? > > Any thoughts and experience shared are much appreciated. > > Thank you very much. > > Regards, > Karen > ============================================================== > ============= To unsubscribe, send email to > [EMAIL PROTECTED] and include in the body of the message > "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". >
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
