EJB Transaction

Karen Low <[email protected]> Wed, 16 Aug 2006 10:57:20 +0800
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <[email protected]>
------=_Part_180938_16125691.1155697040834
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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".


------=_Part_180938_16125691.1155697040834
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,<br><br>I was trying to find out what will be the transaction like for the following scenario:<br><br>Imagine a servlet method get invokes and it's a deep request which does 2 db calls, one is insert, another one is update.
<br><br>Action class (Servlet):<br>&nbsp;&nbsp;&nbsp;&nbsp; ---&gt; Stateless Session Bean (1)&nbsp; ---&gt; POJO ---&gt; Stateless Session Bean (2) ---&gt; POJO (DAO) ==&gt; DB (insert)<br>&nbsp;&nbsp;&nbsp;&nbsp; ---&gt; Stateless Session Bean (1)&nbsp; ---&gt; POJO ---&gt; Stateless Session Bean (2) ---&gt; POJO (DAO) ==&gt; DB (update)
<br><br>Legend: <br>---&gt; calls a method<br>==&gt; DB sql execution<br><br>All EJBs are container managed with transaction attribute set to &quot;Required&quot;. All classes mentioned above are packaged into one ear and deployed into 1 app server.
<br><br>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?
<br><br>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?
<br><br>Any thoughts and experience shared are much appreciated.<br><br>Thank you very much.<br><br>Regards,<br>Karen<br>
===========================================================================
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".
<p>

------=_Part_180938_16125691.1155697040834--