You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Mike Perham <mp...@gmail.com> on 2007/01/03 16:56:09 UTC

Problem with mysql xa and 1.2-beta

I'm using the new 1.2-beta with the mysql-xa connector from wasce
1.1.0.1.  My application does some db work when it starts up and we
don't see this error on 1.1.0.1.  I'm using Spring 1.2.8's
JTATransactionManager like this:

<bean id="inboxTransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
  <property name="transactionManagerName"><value>java:/TransactionManager</value></property>
</bean>

Is this the correct JNDI location?

09:50:32,771 WARN  [Transaction] Unable to enlist XAResource org.apache.geronimo
.transaction.manager.WrapperNamedXAResource@cfb87, errorCode: -9
com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some work is done
outside global transaction
        at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.mapXAExceptionFromSQL
Exception(MysqlXAConnection.java:562)
        at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(Mysql
XAConnection.java:545)
        at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start(MysqlXAConnecti
on.java:485)
        at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(
WrapperNamedXAResource.java:86)
        at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResourc
e(TransactionImpl.java:207)
        at org.apache.geronimo.connector.outbound.TransactionEnlistingIntercepto
r.getConnection(TransactionEnlistingInterceptor.java:54)
        at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.
getConnection(TransactionCachingInterceptor.java:87)
        at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.ge
tConnection(ConnectionHandleInterceptor.java:43)
        at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(
TCCLInterceptor.java:39)
        at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.
getConnection(ConnectionTrackingInterceptor.java:66)
        at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allo
cateConnection(AbstractConnectionManager.java:61)
        at org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56
)
        at $javax.sql.DataSource$$FastClassByCGLIB$$6525cafd.invoke(<generated>)

        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
        at org.apache.geronimo.connector.ConnectorMethodInterceptor.intercept(Co
nnectorMethodInterceptor.java:54)
        at $javax.sql.DataSource$$EnhancerByCGLIB$$f0297be4.getConnection(<gener
ated>)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(D
ataSourceUtils.java:112)
        at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy.g
etConnection(TransactionAwareDataSourceProxy.java:107)
        at org.springframework.orm.ojb.support.LocalDataSourceConnectionFactory.
lookupConnection(LocalDataSourceConnectionFactory.java:88)
        at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection
(Unknown Source)
        at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStateme
nt(Unknown Source)
        at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
 Source)
        at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
Source)
        at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown Source)
        at org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unk
nown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQue
ry(Unknown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery
(Unknown Source)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
Unknown Source)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
Unknown Source)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
Unknown Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery
(Unknown Source)
        at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
yQuery(Unknown Source)
        at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
yQuery(Unknown Source)
        at org.springframework.orm.ojb.PersistenceBrokerTemplate$3.doInPersisten
ceBroker(PersistenceBrokerTemplate.java:192)
        at org.springframework.orm.ojb.PersistenceBrokerTemplate.execute(Persist

Re: Problem with mysql xa and 1.2-beta

Posted by Mike Perham <mp...@gmail.com>.
On 1/3/07, Mike Perham <mp...@gmail.com> wrote:
> On 1/3/07, David Jencks <da...@yahoo.com> wrote:
> >
> >
> > I haven't personally tried the tranql mysql xa adapter (is that the
> > one from wasce?) but I wonder.... have you gotten it to work in other
> > circumstances?
>
> The application gets past this point in wasce 1.1.0.1 so yes.
>

Actually I just realized that I get a "Can't locate
TransactionManager" warning on wasce (because the TM is not bound in
JNDI) so it looks like this "works" on wasce only because it is not
using transactions.  So I guess the answer is actually no.

mike

Re: Problem with mysql xa and 1.2-beta

Posted by Mike Perham <mp...@gmail.com>.
On 1/3/07, David Jencks <da...@yahoo.com> wrote:
>
> On Jan 3, 2007, at 10:56 AM, Mike Perham wrote:
>
> > I'm using the new 1.2-beta with the mysql-xa connector from wasce
> > 1.1.0.1.  My application does some db work when it starts up and we
> > don't see this error on 1.1.0.1.  I'm using Spring 1.2.8's
> > JTATransactionManager like this:
> >
> > <bean id="inboxTransactionManager"
> > class="org.springframework.transaction.jta.JtaTransactionManager">
> >  <property name="transactionManagerName"><value>java:/
> > TransactionManager</value></property>
> > </bean>
> >
> > Is this the correct JNDI location?
>
> I would have expected it to be java:TransactionManager but it's
> possible both values work.  I suspect it's working because apparently
> there is a transaction started and I assume it was started by Spring.

I assumed that value because it is JBoss's location and Geronimo seems
to keep many of JBoss's choices (a good idea in order to make jboss
porting easy, imo).

All of our database access goes through Spring's transacation layer so
your assumption is correct.

>
> I haven't personally tried the tranql mysql xa adapter (is that the
> one from wasce?) but I wonder.... have you gotten it to work in other
> circumstances?

The application gets past this point in wasce 1.1.0.1 so yes.

> One possibility is that there's a bug in the connector.  When a
> connection is not enrolled in a transaction it's supposed have
> autocommit behavior.  If this isn't working you probably wouldn't see
> a problem using a local-tx connector since there isn't much to the
> start of a transaction -- just turning off autocommit.  If it was
> already off you might not see any errors.
>
> Can you put a breakpoint in a likely spot in perhaps the
> WrapperNamedXAResource and see if commit is actually being called?

Not easily.  I don't have a geronimo dev/debug environment nor do I
have the time to invest.  I was given a week or so to port our app
from jboss to wasce and I've shot way over that.  The app does seem to
work in wasce except for that hivemind classloader problem I emailed
you about yesterday.  That is the only thing preventing us from just
running on 1.1.0.1.  I'm trying 1.2-beta on your suggestion to see if
this later code has the same problem but it appears I can't even get
that far due to this issue.

>
> Do you expect there to be any work done outside a transaction?
>

Never.

Re: Problem with mysql xa and 1.2-beta

Posted by Donald Woods <dr...@yahoo.com>.

David Jencks wrote:
> 
> On Jan 3, 2007, at 10:56 AM, Mike Perham wrote:
> 
>> I'm using the new 1.2-beta with the mysql-xa connector from wasce
>> 1.1.0.1.  My application does some db work when it starts up and we
>> don't see this error on 1.1.0.1.  I'm using Spring 1.2.8's
>> JTATransactionManager like this:
>>
>> <bean id="inboxTransactionManager"
>> class="org.springframework.transaction.jta.JtaTransactionManager">
>>  <property 
>> name="transactionManagerName"><value>java:/TransactionManager</value></property> 
>>
>> </bean>
>>
>> Is this the correct JNDI location?
> 
> I would have expected it to be java:TransactionManager but it's possible 
> both values work.  I suspect it's working because apparently there is a 
> transaction started and I assume it was started by Spring.
> 
> I haven't personally tried the tranql mysql xa adapter (is that the one 
> from wasce?) 

No, WASCE doesn't include the MySQL adapter from TranQL.
BTW - WASCE 1.1.0.1 == Geronimo 1.1.1

but I wonder.... have you gotten it to work in other
> circumstances?
> 
> One possibility is that there's a bug in the connector.  When a 
> connection is not enrolled in a transaction it's supposed have 
> autocommit behavior.  If this isn't working you probably wouldn't see a 
> problem using a local-tx connector since there isn't much to the start 
> of a transaction -- just turning off autocommit.  If it was already off 
> you might not see any errors.
> 
> Can you put a breakpoint in a likely spot in perhaps the 
> WrapperNamedXAResource and see if commit is actually being called?
> 
> Do you expect there to be any work done outside a transaction?
> 
> thanks
> david jencks
> 
>>
>> 09:50:32,771 WARN  [Transaction] Unable to enlist XAResource 
>> org.apache.geronimo
>> .transaction.manager.WrapperNamedXAResource@cfb87, errorCode: -9
>> com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some 
>> work is done
>> outside global transaction
>>        at 
>> com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.mapXAExceptionFromSQL
>> Exception(MysqlXAConnection.java:562)
>>        at 
>> com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(Mysql
>> XAConnection.java:545)
>>        at 
>> com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start(MysqlXAConnecti
>> on.java:485)
>>        at 
>> org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(
>> WrapperNamedXAResource.java:86)
>>        at 
>> org.apache.geronimo.transaction.manager.TransactionImpl.enlistResourc
>> e(TransactionImpl.java:207)
>>        at 
>> org.apache.geronimo.connector.outbound.TransactionEnlistingIntercepto
>> r.getConnection(TransactionEnlistingInterceptor.java:54)
>>        at 
>> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.
>> getConnection(TransactionCachingInterceptor.java:87)
>>        at 
>> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.ge
>> tConnection(ConnectionHandleInterceptor.java:43)
>>        at 
>> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(
>> TCCLInterceptor.java:39)
>>        at 
>> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.
>> getConnection(ConnectionTrackingInterceptor.java:66)
>>        at 
>> org.apache.geronimo.connector.outbound.AbstractConnectionManager.allo
>> cateConnection(AbstractConnectionManager.java:61)
>>        at 
>> org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56
>> )
>>        at 
>> $javax.sql.DataSource$$FastClassByCGLIB$$6525cafd.invoke(<generated>)
>>
>>        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
>>        at 
>> org.apache.geronimo.connector.ConnectorMethodInterceptor.intercept(Co
>> nnectorMethodInterceptor.java:54)
>>        at 
>> $javax.sql.DataSource$$EnhancerByCGLIB$$f0297be4.getConnection(<gener
>> ated>)
>>        at 
>> org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(D
>> ataSourceUtils.java:112)
>>        at 
>> org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy.g
>> etConnection(TransactionAwareDataSourceProxy.java:107)
>>        at 
>> org.springframework.orm.ojb.support.LocalDataSourceConnectionFactory.
>> lookupConnection(LocalDataSourceConnectionFactory.java:88)
>>        at 
>> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection
>> (Unknown Source)
>>        at 
>> org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStateme
>> nt(Unknown Source)
>>        at 
>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
>> Source)
>>        at 
>> org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
>> Source)
>>        at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unk
>> nown Source)
>>        at 
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQue
>> ry(Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery
>> (Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
>> Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
>> Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
>> Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery
>> (Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
>> yQuery(Unknown Source)
>>        at 
>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
>> yQuery(Unknown Source)
>>        at 
>> org.springframework.orm.ojb.PersistenceBrokerTemplate$3.doInPersisten
>> ceBroker(PersistenceBrokerTemplate.java:192)
>>        at 
>> org.springframework.orm.ojb.PersistenceBrokerTemplate.execute(Persist
> 
> 
> 

Mike, for WASCE specific questions, try using our devWorks forum at -
http://www-128.ibm.com/developerworks/forums/dw_forum.jsp?forum=541&cat=51


-Donald

Re: Problem with mysql xa and 1.2-beta

Posted by David Jencks <da...@yahoo.com>.
On Jan 3, 2007, at 10:56 AM, Mike Perham wrote:

> I'm using the new 1.2-beta with the mysql-xa connector from wasce
> 1.1.0.1.  My application does some db work when it starts up and we
> don't see this error on 1.1.0.1.  I'm using Spring 1.2.8's
> JTATransactionManager like this:
>
> <bean id="inboxTransactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager">
>  <property name="transactionManagerName"><value>java:/ 
> TransactionManager</value></property>
> </bean>
>
> Is this the correct JNDI location?

I would have expected it to be java:TransactionManager but it's  
possible both values work.  I suspect it's working because apparently  
there is a transaction started and I assume it was started by Spring.

I haven't personally tried the tranql mysql xa adapter (is that the  
one from wasce?) but I wonder.... have you gotten it to work in other  
circumstances?

One possibility is that there's a bug in the connector.  When a  
connection is not enrolled in a transaction it's supposed have  
autocommit behavior.  If this isn't working you probably wouldn't see  
a problem using a local-tx connector since there isn't much to the  
start of a transaction -- just turning off autocommit.  If it was  
already off you might not see any errors.

Can you put a breakpoint in a likely spot in perhaps the  
WrapperNamedXAResource and see if commit is actually being called?

Do you expect there to be any work done outside a transaction?

thanks
david jencks

>
> 09:50:32,771 WARN  [Transaction] Unable to enlist XAResource  
> org.apache.geronimo
> .transaction.manager.WrapperNamedXAResource@cfb87, errorCode: -9
> com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some  
> work is done
> outside global transaction
>        at  
> com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.mapXAExceptionFromSQL
> Exception(MysqlXAConnection.java:562)
>        at  
> com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(Mysql
> XAConnection.java:545)
>        at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start 
> (MysqlXAConnecti
> on.java:485)
>        at  
> org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(
> WrapperNamedXAResource.java:86)
>        at  
> org.apache.geronimo.transaction.manager.TransactionImpl.enlistResourc
> e(TransactionImpl.java:207)
>        at  
> org.apache.geronimo.connector.outbound.TransactionEnlistingIntercepto
> r.getConnection(TransactionEnlistingInterceptor.java:54)
>        at  
> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.
> getConnection(TransactionCachingInterceptor.java:87)
>        at  
> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.ge
> tConnection(ConnectionHandleInterceptor.java:43)
>        at  
> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(
> TCCLInterceptor.java:39)
>        at  
> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.
> getConnection(ConnectionTrackingInterceptor.java:66)
>        at  
> org.apache.geronimo.connector.outbound.AbstractConnectionManager.allo
> cateConnection(AbstractConnectionManager.java:61)
>        at org.tranql.connector.jdbc.DataSource.getConnection 
> (DataSource.java:56
> )
>        at $javax.sql.DataSource$$FastClassByCGLIB$$6525cafd.invoke 
> (<generated>)
>
>        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
>        at  
> org.apache.geronimo.connector.ConnectorMethodInterceptor.intercept(Co
> nnectorMethodInterceptor.java:54)
>        at $javax.sql.DataSource$$EnhancerByCGLIB$ 
> $f0297be4.getConnection(<gener
> ated>)
>        at  
> org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(D
> ataSourceUtils.java:112)
>        at  
> org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy.g
> etConnection(TransactionAwareDataSourceProxy.java:107)
>        at  
> org.springframework.orm.ojb.support.LocalDataSourceConnectionFactory.
> lookupConnection(LocalDataSourceConnectionFactory.java:88)
>        at  
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection
> (Unknown Source)
>        at  
> org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStateme
> nt(Unknown Source)
>        at  
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
> Source)
>        at  
> org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
> Source)
>        at org.apache.ojb.broker.accesslayer.RsIterator.<init> 
> (Unknown Source)
>        at  
> org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unk
> nown Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQue
> ry(Unknown Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery
> (Unknown Source)
>        at  
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
> Unknown Source)
>        at  
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
> Unknown Source)
>        at  
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(
> Unknown Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery
> (Unknown Source)
>        at  
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
> yQuery(Unknown Source)
>        at  
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionB
> yQuery(Unknown Source)
>        at org.springframework.orm.ojb.PersistenceBrokerTemplate 
> $3.doInPersisten
> ceBroker(PersistenceBrokerTemplate.java:192)
>        at  
> org.springframework.orm.ojb.PersistenceBrokerTemplate.execute(Persist