You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by "Gustavo N. Fernandes" <gu...@terra.com.br> on 2006/08/24 03:27:02 UTC
Enlist XAResource error
Hi, I am using Jencks 1.2 + tranql with oracle adapter 1.0 to do local tests
of a JTA environment, using Geronimo Transaction Manager 1.0.
When I deal with only plain jdbc and jms everything works fine, I can make
distributed transactions (commit and rollback) but when I try to use
Hibernate Session Factory(created thru Spring), I have this strange errors:
WARN Transaction - Unable to enlist XAResource
org.apache.geronimo.transaction.manager.WrapperNam edXAResource@2aff693e,
errorCode: -3
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleX AResource.java:1190)
at oracle.jdbc.xa.client.OracleXAResource.start(Oracl eXAResource.java:311)
at org.apache.geronimo.transaction.manager.WrapperNam
edXAResource.start(WrapperNamedXAResource.java:86)
at org.apache.geronimo.transaction.manager.Transactio
nImpl.enlistResource(TransactionImpl.java:173)
at org.apache.geronimo.transaction.context.Inheritabl
eTransactionContext.enlistResource(InheritableTran sactionContext.java:92)
at org.apache.geronimo.connector.outbound.Transaction
EnlistingInterceptor.getConnection(TransactionEnli stingInterceptor.java:53)
at org.apache.geronimo.connector.outbound.Transaction
CachingInterceptor.getConnection(TransactionCachin gInterceptor.java:81)
at org.apache.geronimo.connector.outbound.ConnectionH
andleInterceptor.getConnection(ConnectionHandleInt erceptor.java:43)
at org.apache.geronimo.connector.outbound.TCCLInterce
ptor.getConnection(TCCLInterceptor.java:39)
at org.apache.geronimo.connector.outbound.AbstractCon
nectionManager.allocateConnection(AbstractConnecti onManager.java:61)
at org.tranql.connector.jdbc.DataSource.getConnection (DataSource.java:56)
at org.springframework.orm.hibernate3.LocalDataSource
ConnectionProvider.getConnection(LocalDataSourceCo nnectionProvider.java:81)
and then:
Caused by: java.sql.SQLException: ORA-02089: COMMIT is not allowed in a
subordinate session
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:2 89)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol .java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe
(TTC7Protocol.java:880)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(
OracleStatement.java:2516)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTi
meout(OracleStatement.java:2850)
at oracle.jdbc.driver.OraclePreparedStatement.execute
Update(OraclePreparedStatement.java:609)
at oracle.jdbc.driver.OraclePreparedStatement.execute
Query(OraclePreparedStatement.java:537)
at org.tranql.connector.jdbc.PreparedStatementHandle.
executeQuery(PreparedStatementHandle.java:49)
I suspect the enlist error causes the second error. Any clues?
Here is my Spring configuration:
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
<bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManag erFactoryBean"/>
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTran sactionManager">
<property name="userTransaction" ref="userTransaction"/>
</bean>
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean"
lazy-init="true">
<property name="mappingResources">
<list>
<value>queries.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop
key="hibernate.cache.use_query_cache">true</prop>
<prop
key="hibernate.jdbc.fetch_size">200</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop
key="hibernate.cglib.use_reflection_optimizer">
true
</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="transactionSupport"
class="org.jencks.factory.XATransactionFactoryBean ">
<property name="useTransactionCaching">
<value>true</value>
</property>
<property name="useThreadCaching">
<value>false</value>
</property>
</bean>
<bean id="poolingSupport"
class="org.jencks.factory.SinglePoolFactoryBean">
<property name="maxSize">
<value>2</value>
</property>
<property name="minSize">
<value>1</value>
</property>
<property name="blockingTimeoutMilliseconds">
<value>60</value>
</property>
<property name="idleTimeoutMinutes">
<value>60</value>
</property>
<property name="matchOne">
<value>true</value>
</property>
<property name="matchAll">
<value>true</value>
</property>
<property name="selectOneAssumeMatch">
<value>true</value>
</property>
</bean>
<bean id="connectionManager"
class="org.jencks.factory.ConnectionManagerFactory Bean">
<property name="transactionSupport">
<ref local="transactionSupport"/>
</property>
<property name="poolingSupport">
<ref local="poolingSupport"/>
</property>
</bean>
<!-- Interceptor de transacao -->
<bean id="transIntercept"
class="org.springframework.transaction.interceptor .TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop
key="*">PROPAGATION_REQUIRES_NEW,-Exception</prop>
</props>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jca.support.LocalConnec tionFactoryBean">
<property name="managedConnectionFactory">
<ref bean="tranqlManagedConnectionFactory"/>
</property>
<property name="connectionManager">
<ref bean="connectionManager"/>
</property>
</bean>
<bean id="tranqlManagedConnectionFactory"
class="org.tranql.connector.oracle.XAMCF">
<property name="driverType" value="thin"/>
<property name="serverName" value="host"/>
<property name="portNumber" value="port"/>
<property name="serviceName" value="int"/>
<property name="userName" value="user"/>
<property name="password" value="pas"/>
</bean>
<bean id="connectionFactory"
class="org.springframework.jca.support.LocalConnec tionFactoryBean">
<property name="managedConnectionFactory">
<ref local="jmsManagedConnectionFactory"/>
</property>
<property name="connectionManager">
<ref local="connectionManager"/>
</property>
</bean>
</beans>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.5/425 - Release Date: 22/8/2006