XA 数据源和驾驶舱
XA Datasource and cockpit
我将两个 XA 数据源用于 EAP7 和 MySQL。该应用程序是 运行,但在调用驾驶舱后抛出了很多异常。版本 7.5 中的 Camunda
两者的配置相同。 (由 Red Hat EAP Docker 图片生成)
<xa-datasource jndi-name="java:jboss/datasources/ProcessEngine"
pool-name="eap_app_mysql-DB" use-java-context="true" enabled="true">
<xa-datasource-property name="ServerName">12.345.678.90</xa-datasource-property>
<xa-datasource-property name="Port">3306</xa-datasource-property>
<xa-datasource-property name="DatabaseName">processengine</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<validation>
<validate-on-match>true</validate-on-match>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"></valid-connection-checker>
<exception-sorter
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"></exception-sorter>
</validation>
</xa-datasource>
我试图缩短日志并在此处粘贴完整的 https://hastebin.com/safegezoxo.hs
[org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-91) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=true pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=TransactionSynchronization@1199406255{tx=TransactionImple < ac, BasicAction: 0:ffff0ac006d8:-7ec69b48:58ac47a3:84f52 status: ActionStatus.RUNNING > wasTrackByTx=true enlisted=false cancel=false}]: com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction
...
Caused by: java.sql.SQLException: XAER_OUTSIDE: Some work is done outside global transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:562)
... 99 more
[com.arjuna.ats.jta] (default task-91) ARJUNA016061: TransactionImple.enlistResource - XAResource.start returned: XAException.XAER_OUTSIDE for < formatId=131077, gtrid_length=43, bqual_length=36, tx_uid=0:ffff0ac006d8:-7ec69b48:58ac47a3:84f52, node_name=eap-app-4-wxyq3, branch_uid=0:ffff0ac006d8:-7ec69b48:58ac47a3:84f54, subordinatenodename=null, eis_name=java:jboss/datasources/ProcessEngine >: com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction
### Error querying database. Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/ProcessDefinition.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity.selectProcessDefinition
### The error occurred while executing a query
### Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/ProcessDefinition.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity.selectProcessDefinition
### The error occurred while executing a query
### Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
我已经更改了数据源工厂,结果没有问题:
<xa-datasource jndi-name="java:jboss/datasources/ProcessEngine"
pool-name="eap_app_mysql-DB" use-java-context="true" enabled="true">
<xa-datasource-property name="ServerName">IP</xa-datasource-property>
<xa-datasource-property name="Port">PORT</xa-datasource-property>
<xa-datasource-property name="DatabaseName">processengine</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>60</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
<no-tx-separate-pools>true</no-tx-separate-pools>
<pad-xid>false</pad-xid>
<wrap-xa-resource>true</wrap-xa-resource>
</xa-pool>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
我将两个 XA 数据源用于 EAP7 和 MySQL。该应用程序是 运行,但在调用驾驶舱后抛出了很多异常。版本 7.5 中的 Camunda
两者的配置相同。 (由 Red Hat EAP Docker 图片生成)
<xa-datasource jndi-name="java:jboss/datasources/ProcessEngine"
pool-name="eap_app_mysql-DB" use-java-context="true" enabled="true">
<xa-datasource-property name="ServerName">12.345.678.90</xa-datasource-property>
<xa-datasource-property name="Port">3306</xa-datasource-property>
<xa-datasource-property name="DatabaseName">processengine</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<validation>
<validate-on-match>true</validate-on-match>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"></valid-connection-checker>
<exception-sorter
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"></exception-sorter>
</validation>
</xa-datasource>
我试图缩短日志并在此处粘贴完整的 https://hastebin.com/safegezoxo.hs
[org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-91) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=true pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=TransactionSynchronization@1199406255{tx=TransactionImple < ac, BasicAction: 0:ffff0ac006d8:-7ec69b48:58ac47a3:84f52 status: ActionStatus.RUNNING > wasTrackByTx=true enlisted=false cancel=false}]: com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction
...
Caused by: java.sql.SQLException: XAER_OUTSIDE: Some work is done outside global transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:562)
... 99 more
[com.arjuna.ats.jta] (default task-91) ARJUNA016061: TransactionImple.enlistResource - XAResource.start returned: XAException.XAER_OUTSIDE for < formatId=131077, gtrid_length=43, bqual_length=36, tx_uid=0:ffff0ac006d8:-7ec69b48:58ac47a3:84f52, node_name=eap-app-4-wxyq3, branch_uid=0:ffff0ac006d8:-7ec69b48:58ac47a3:84f54, subordinatenodename=null, eis_name=java:jboss/datasources/ProcessEngine >: com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_OUTSIDE: Some work is done outside global transaction
### Error querying database. Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/ProcessDefinition.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity.selectProcessDefinition
### The error occurred while executing a query
### Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/ProcessDefinition.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity.selectProcessDefinition
### The error occurred while executing a query
### Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6de438d4[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 connection handles=0 lastReturned=1487744241500 lastValidated=1487744110263 lastCheckedOut=1487744241705 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3de504bf mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@199913f6[pool=eap_app_mysql-DB] xaResource=XAResourceWrapperImpl@4da0c70d[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@53389a35 pad=false overrideRmValue=null productName=MySQL productVersion=5.7.16 jndiName=java:jboss/datasources/ProcessEngine] txSync=null]
我已经更改了数据源工厂,结果没有问题:
<xa-datasource jndi-name="java:jboss/datasources/ProcessEngine"
pool-name="eap_app_mysql-DB" use-java-context="true" enabled="true">
<xa-datasource-property name="ServerName">IP</xa-datasource-property>
<xa-datasource-property name="Port">PORT</xa-datasource-property>
<xa-datasource-property name="DatabaseName">processengine</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>60</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
<no-tx-separate-pools>true</no-tx-separate-pools>
<pad-xid>false</pad-xid>
<wrap-xa-resource>true</wrap-xa-resource>
</xa-pool>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>