i am using WSAD 5.0 and oracle 8.1.7. I am making statefull session bean. Statefull session bean calls method m1() of design pattern DAO object (dao1). In method m1() oracle connection is opened using jdbc driver record is inserted and connection is closed. After calling method m1(), stateful session bean calls another method m2() of another design pattern DAO object (dao2). In method m2() oracle connection is opened using jdbc driver, record is inserted and connection is closed. this oracle database is different from another. I want to make both insertions under one transaction without changing any of DAOs.
if i use bean managed transaction and simple jdbc driver and usertransaction object then it gives me error
[1/6/04 17:28:31:322 GMT+05:30] 273978f2 TransactionIm E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
if i use bean managed transaction and XA jdbc driver and usertransaction object then it gives me some error at the time of starting WSAD test server that XAResource not availbale.
Please help me out
-
problem in 2 phase commit (4 messages)
- Posted by: sumeet bansal
- Posted on: January 06 2004 07:24 EST
Threaded Messages (4)
- problem in 2 phase commit by Sanjaya Ganesh on January 06 2004 11:08 EST
- problem in 2 phase commit by sumeet bansal on January 07 2004 00:07 EST
- problem in 2 phase commit by Michael Malkinzon on January 08 2004 03:25 EST
- problem in 2 phase commit by sumeet bansal on January 07 2004 00:07 EST
- problem in 2 phase commit by Badrish Agarwal on January 06 2004 23:29 EST
-
problem in 2 phase commit[ Go to top ]
- Posted by: Sanjaya Ganesh
- Posted on: January 06 2004 11:08 EST
- in response to sumeet bansal
You will have to obtain the connection via the container (using JNDI data source lookup) and only such a connection will give you 2PC ! I guess I understood the issue properly. Without this, you will get the error for sure.
-Sanjay -
problem in 2 phase commit[ Go to top ]
- Posted by: sumeet bansal
- Posted on: January 07 2004 00:07 EST
- in response to Sanjaya Ganesh
i am already taking connection from connection pool through jndi. is there any restriction on using classes12.zip of oracle 8.1.7. This i am thinking because when i specify driver as XA driver then at the time of starting test server, it gives me error Can not use XA resource. -
problem in 2 phase commit[ Go to top ]
- Posted by: Michael Malkinzon
- Posted on: January 08 2004 15:25 EST
- in response to sumeet bansal
XAResource is the only type that can perform 2PC. see https://www.theserverside.com/home/thread.jsp?thread_id=23151 .
Check if you have licensing for 2PC.
Mike -
problem in 2 phase commit[ Go to top ]
- Posted by: Badrish Agarwal
- Posted on: January 06 2004 23:29 EST
- in response to sumeet bansal
This is transaction across databases so you'll have to use xa jdbc drivers.
Also, connection needs be taken through container(data source).
One more option:
Your transaction is across Oracle databases. Oracle provides a facility called link for access of different database(oracle) from a single database.
Link takes care of two phase commit.
This way you can avoid use of xa driver.
Thanks,
Badrish