当它尝试提交事务时,我在weblogic 10/jre6/hibernate 3.6.10中遇到了问题。你能帮帮我吗?
我AdminServer_xxx.log只有这个堆栈:
####<[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1570440458465> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB myService.v2.connecteur.connecteurJavaBean.executerService(java.lang.String)],Xid=BEA1-00022F8C16F0D799C74D(22622538),Status=Rolling Back. [Reason=weblogic.transaction.internal.TimedOutException: Timed out tx=BEA1-00022F8C16F0D799C74D after 300 seconds],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=424,seconds left=60,XAServerResourceInfo[xxx]=(ServerResourceInfo[xxx]=(state=rolledback,assigned=AdminServer_xxx),xar=xxx,re-Registered = false),XAServerResourceInfo[DsOracle_xxx]=(ServerResourceInfo[DsOracle_xxx]=(state=rolledback,assigned=AdminServer_xxx),xar=DsOracle_xxx,re-Registered = false),NonXAServerResourceInfo[WL_JDBC_LLR_POOL.DsOracle_xxx]=(ServerResourceInfo[WL_JDBC_LLR_POOL.DsOracle_xxx]=(state=rolledback,assigned=AdminServer_xxx),nonXAResource=JDBC LLR, pool=DsOracle_xxx, table=ORUSER.WL_LLR_ADMINSERVER_XXX),SCInfo[xxx]=(state=rolledback),SCInfo[LDBUS+Sync96jp-x91]=(state=rolling-back),properties=({weblogic.transaction.nonXAResource=WL_JDBC_LLR_POOL.DsOracle_xxx, weblogic.jdbc.remote.DsOracle_xxx=t3://x.x.x.x:9003, weblogic.transaction.name=[EJB myService.v2.connecteur.connecteurJavaBean.executerService(java.lang.String)], weblogic.jdbc.llr=DsOracle_xxx}),local properties=({weblogic.jdbc.jta.DsOracle_xxx=[ No XAConnection is attached to this TxInfo ], weblogic.jdbc.jta.xxx=[ No XAConnection is attached to this TxInfo ]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=AdminServer_xxx+x.x.x.x:9003+XXX+t3+, XAResources={dsTxS4_FF_SI_StreamAnt, DsOracle_da042_XA_FF_SI_StreamAnt, xxx, xxx},NonXAResources={})],CoordinatorURL=xxx+x.x.x.x:9003+xxx+t3+): weblogic.transaction.RollbackException: Timed out tx=BEA1-00022F8C16F0D799C74D after 300 seconds
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1884)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:376)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:267)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:625)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at myService.v2.connecteur.connecteur_AAA_tpyl5k_EOImpl.executerService(Unknown Source)
at myService.v2.connecteur.connecteur_AAA_tpyl5k_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:263)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: weblogic.transaction.internal.TimedOutException: Timed out tx=BEA1-00022F8C16F0D799C74D after 300 seconds
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1879)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1706)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1616)
at weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:284)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:550)
... 2 more
我想这可能是数据源的错误配置:
<jdbc-data-source xmlns="http://xmlns.oracle.com/weblogic/jdbc-data-source" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/jdbc-data-source http://xmlns.oracle.com/weblogic/jdbc-data-source/1.2/jdbc-data-source.xsd">
<name>DsOracle_XXX</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@x.x.x.x:1521/XE</url>
<driver-name>oracle.jdbc.xa.client.OracleXADataSource</driver-name>
<properties>
<property>
<name>user</name>
<value>user</value>
</property>
</properties>
<password-encrypted>pwd</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>DsOracle_XXX</jndi-name>
<global-transactions-protocol>TwoPhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
<jdbc-xa-params>
<keep-xa-conn-till-tx-complete>false</keep-xa-conn-till-tx-complete>
<xa-set-transaction-timeout>true</xa-set-transaction-timeout>
<xa-transaction-timeout>0</xa-transaction-timeout>
<rollback-local-tx-upon-conn-close>false</rollback-local-tx-upon-conn-close>
</jdbc-xa-params>
</jdbc-data-source>
或处于休眠状态.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">DsOracle_XXX</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="current_session_context_class">jta</property>
<property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property>
<mapping resource="persistance/hibernate/mapping/xxx.hbm.xml"/>
</session-factory>
</hibernate-configuration>
谢谢你的帮助, 尼科斯。
我们终于在数据源配置中找到了解决方案。
谢谢伊曼纽尔的帮助。
这是工作配置:
<jdbc-xa-params>
<keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
<keep-logical-conn-open-on-release>false</keep-logical-conn-open-on-release>
<resource-health-monitoring>true</resource-health-monitoring>
<xa-set-transaction-timeout>true</xa-set-transaction-timeout>
<xa-transaction-timeout>0</xa-transaction-timeout>
<rollback-local-tx-upon-conn-close>true</rollback-local-tx-upon-conn-close>
</jdbc-xa-params>
我希望它能帮助其他人:)
问候 尼科斯