dcsimg
Transaction involving two Stateless Session Beans ,updating two diffrent Databases.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brayan_C
Posted On:   Wednesday, July 3, 2002 05:44 AM

I am using Weblogic App Server(v6.1). I have 2 Stateless Session Beans,, myBeanA and myBeanB Both using Container managed transaction. {myBeanA has business methodX() whose Transaction attribute is set to Required in the XML descriptor.} {myBeanB has business methodY() whose Transaction attribute is set to RequiresNew in the XML descriptor.} My servlet calls methodX() in BeanA which does the following and in the sequence mentioned below: 1. Updates Database DB1 (uses a connection from connection Pool P1). 2. Looks up for BeanB and calls methodY(). methodY() updates another Database DB2(uses a DB connection from connection Pool P2). ----------I have 2 questions:-    More>>

I am using Weblogic App Server(v6.1).

I have 2 Stateless Session Beans,, myBeanA and myBeanB
Both using Container managed transaction.

{myBeanA has business methodX() whose Transaction attribute is set to Required in the XML descriptor.}

{myBeanB has business methodY() whose Transaction attribute is set to RequiresNew in the XML descriptor.}

My servlet calls methodX() in BeanA which does the following and in the sequence mentioned below:

1. Updates Database DB1 (uses a connection from connection Pool P1).
2. Looks up for BeanB and calls methodY().
methodY() updates another Database DB2(uses a DB connection from connection Pool P2).

----------I have 2 questions:-

(1) If there is run time exception in methodY() which will rollback the Transaction of DB2. Will it also rollback the
Transaction of DB1?(Note the Transaction attributes I have mentioned)-----


(2)Is it Illegal to use connections from 2 diffrent pools in the same Transaction?

   <<Less

Re: Transaction involving two Stateless Session Beans ,updating two diffrent Databases.

Posted By:   Gautam_Marwaha  
Posted On:   Wednesday, July 3, 2002 06:00 AM

1. no. maybe you write code to do it yourself
2. no. this will be allowed if you use XA drivers and support for 2-phase commit is provided.
About | Sitemap | Contact