ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mrEdmundo" <mrEdmu...@uko2.co.uk>
Subject RE: java.lang.IllegalStateException retrieving SqlMapClient
Date Thu, 27 Apr 2006 10:21:02 GMT
I think i've found the problem. I had the <transaction-type> in my
ejb-jar.xml file set to Container rather than Bean causing the app server to
try and manage transactions i didn't want it to. Hence the error arising
when i wasn't using a transaction in that method.
I guess Orion doesn't try to create transactions unless you specify them in
code... but Sun App Server does.
Thanks, Ed.


From: mrEdmundo [mailto:mrEdmundo@uko2.co.uk] 
Sent: 27 April 2006 08:23
To: user-java@ibatis.apache.org
Subject: java.lang.IllegalStateException retrieving SqlMapClient

Hi there,
I'm having some trouble migrating a J2EE application from Orion to Sun Java
System Application Server. It's working fine on Orion, but I get the
following error when i'm running the application on the Sun App Server. It
occurs when trying to execute a sqlMap.queryForList method call. 
java.sql.SQLException: Error in allocating a connection. Cause:
java.lang.IllegalStateException: Local transaction already has 1 non-XA
Resource: cannot add more resources.
The datasources are being managed by the app server so i'm using JNDI to
access them. I'm thinking it must be down to the Sun Datasource
configuration, but i'm just not too sure where to start looking as i'm not
too sure how iBatis is using the connection pools.
When i'm just using one SqlMapClient in an EJB it all works ok. It's failing
when i'm using one SqlMapClient in the EJB and one in a supporting utility
class. They are different clients, using different user credentials (as one
is read only client, and the other is a read/write user). So they should
also be coming from different dB connection pools.
This all worked in Orion, but now I get the transaction error... does anyone
have any ideas on where i should be looking? I've tried setting
'RelaxAutoCommit' to true (as it's false by default) but it didn't help...
I'm using iBatis v2.0.7, Sun App Server v8.2, and connector/j JDBC drivers
for mysql v3.1.8
Thanks in advance for any suggestions, thanks Ed.

View raw message