Bugs item #553916, was opened at 2002-05-08 14:56
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=553916&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: rm (tols)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: DDL commands in XA transactions

Initial Comment:
Hi,

In the course of helping someone debug Tyrex with JBoss I 
came across a problem in the class 
org.jboss.ejb.plugins.jaws.jdbc.JDBCInitCommand, namely 
that a DDL operation (create table) was being executed in an XA 
transaction. The same is true of the class 
org.jboss.ejb.plugins.jaws.jdbc.JDBCDestroyCommand (drop 
table). 

This normally is not supported because there is an 
implicit commit with DDL commands. Basically a non-XA datasource 
needs to be specified for doing this.

Here are the references 
for 
Oracle:

http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76939/adga1_xa.htm#622503

http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a88876/adga1_xa.htm#622503

Riad

----------------------------------------------------------------------

>Comment By: Larry Sanderson (lsanders)
Date: 2002-05-14 10:28

Message:
Logged In: YES 
user_id=379453

Some info from the JDBC 3.0 spec:

Participation in a distributed transaction is defined as 
the work done between
invocations of the methods XAResource.start and 
XAResource.end. Outside
these boundaries, the transaction mode is local, and a 
connection behaves exactly
like a local connection.

So, all compliant JDBC XA drivers must operate as local 
connections outside of a global tx.  

----------------------------------------------------------------------

Comment By: rm (tols)
Date: 2002-05-14 10:16

Message:
Logged In: YES 
user_id=539346

The problem is general to all databases, not just Oracle, because DDL 
commands imply an immediate implicit commit and so cannot be part of a 
transaction. The person I was helping had this problem with 
Informix.

The code begins and commits a transaction around the DDL 
call (from org.jboss.ejb.plugins.jaws.jdbc.JDBCInitCommand line 
147):

// since we use the pools, we have to do this within a 
transaction
factory.getContainer().getTransactionManager().begin();
jdbcExecute(null);
factory.getContainer().getTransactionManager().commit();

So 
you can
1) Not wrap the call in a transaction
2) Use a non-XA data 
source

I'm not familiar with the JBoss code but #1 seems like the way to 
go.

----------------------------------------------------------------------

Comment By: Dr. Christoph Georg Jung (cgjung)
Date: 2002-05-14 06:14

Message:
Logged In: YES 
user_id=175199

My experiences with the Oracle8/9 jdbc driver & XA:

Once a connection sees a distributed transaction, it will 
have two flags raised (UsingXA and ... hmmm ... 
XAThrowsError or so) which will not allow you to a) do 
any execution without a transaction associated and b) 
shortly set that connection into auto-commit mode.

If you manipulate the flags explicitely (setUsingXA, 
setXAThrows...), it is possible to do such cool things as 
raw-reads in between XA interactions. I�m not sure about 
DDL stuff, but I guess that should work too. We do that
after xa_commit, xa_rollback and xa_forget, havn�t tested 
it after xa_suspend ...
 

----------------------------------------------------------------------

Comment By: David Jencks (d_jencks)
Date: 2002-05-14 05:37

Message:
Logged In: YES 
user_id=60525

Suspending the current tx and not starting a new one would
probably work with any driver using the local wrapper, since
that executes statements outside a managed tx in autocommit
mode.  I don't know about the xa wrapper, I haven't
rewritten it yet.

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-05-13 21:57

Message:
Logged In: YES 
user_id=251431

So what do you want me to do about it?  Is this an Oracle 
only issue?  

I could just suspend the current transaction and not start 
a new one.  I don't really care; I'm just sick of fixing 
this code.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=553916&group_id=22866

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to