aspose file tools*
The moose likes BEA/Weblogic and the fly likes Switching to an XA JDBC driver explodes the console output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Switching to an XA JDBC driver explodes the console output" Watch "Switching to an XA JDBC driver explodes the console output" New topic
Author

Switching to an XA JDBC driver explodes the console output

Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hi,

I recently swapped in the Oracle XA JDBC driver to replace the non-XA driver I had used before. Now, suddenly I get a *lot* of the following in the console output:

So, this raises two questions:

(1) Why am I getting an XAException from the connection test? What can I do to stop it? What am I doing wrong?

(2) Is there any way to filter out those "connection for ... closed" and "connection for ... refreshed" messages from the log? They would be alright if I'd put the console output to /dev/null but since I have to pipe it into a log file (nohup.out), I'm worrying that the size of those log files will grow too fast (I've already seen one nohup.out file of 2 gigs which got all sorts of red lights flashing but that was due to a WebLogic bug...).

And thanks for your effort reading this far


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
can you provide some more information about what versions of Oracle database,WebLogic Server, oracle driver(JDBC 2.0?) you are using and the setting of ur connection pool and datasource?
maybe u didnt select honor global transactions for your datasource and u changed the driver of ur connection pool, or u should delete the existing datasource and create a new one with honor global transactions to use the connection pool.
It seems that the failure occurred at javax.transaction.xa.XAResource.prepare() in ur situation.
By the way don't create two Tx Data Sources that point to the same connection pool. If a transaction uses two different Tx Data Sources which are both pointed to the same connection pool, you will get an XA_PROTO error when you try to access the second connection.


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks, Billy.

I'm pretty sure I enabled global transactions but I'll post that and other configuration details tomorrow when I'm at the office again.

This is what I remember about the product versions:
- WebLogic 8.1 sp3
- Oracle 9.2.x
- Oracle 10.x driver, the one that comes with WLS 8.1 SP3
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Billy Tsai:
can you provide some more information about what versions of Oracle database,WebLogic Server, oracle driver(JDBC 2.0?) you are using and the setting of ur connection pool and datasource?


Ok. Here's the DataSource/ConnectionPool configs from my config.xml:
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Why do you have a DataSource class specified as the driver name of your connection pool?
DriverName="oracle.jdbc.xa.client.OracleXADataSource"

You can just use the normal oracle.jdbc.driver.OracleDriver and Weblogic will take care of using the correct data source depending on whether it is TX enabled or not...

Try that and let me know...


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Here is a clip form my config.xml




The only thing you should ignore from my version is the "@(description..."
part because we have to go around a firewall to access out database.

I hope that helps

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks guys.

Val, that didn't work. The problem was that someone somewhere uses local transactions with the pool and when someone else creates a global transaction, it all comes to pieces...

Mark, may I ask why you use the verbose (foo=bar) format? I've only seen people use that with the OCI driver (tnsnames.ora).

Anyway, I think I figured out a solution. I switched to using WebLogic's own Oracle JDBC XA driver (weblogic.jdbcx.oracle.OracleDataSource) and set the RollbackLocalTxUponConnClose property for the connection pool to "true" (effectively causing all those local transactions to finish along with the connection being returned back to the pool.

I'll let you know whether I broke anything with that...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Mark, may I ask why you use the verbose (foo=bar) format?


What do you actually mean by that all the properties of the tag are name=value. Is there a specific one you are talking about. Are you talking about the part to get past our internal Firewalls?

Mark
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Mark Spritzler:
What do you actually mean by that all the properties of the tag are name=value. Is there a specific one you are talking about. Are you talking about the part to get past our internal Firewalls?

Yes. the URL parameter:

How does that help you get through a firewall?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switching to an XA JDBC driver explodes the console output