我已经下载了Camunda 7.10(Wildfly完整发行版),并使用默认的H2(内存)数据库进行了一些测试,一切正常。
然后,我将standalone.xml
配置为使用Oracle 11g数据库。
在部署了camunda-example-invoice-7.10.0.war
的情况下启动服务器后,我得到了一个例外:
12:12:45,570 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service org.camunda.bpm.platform.process-application-module."deployment.camunda-example-invoice-7.10.0.war".START: org.jboss.msc.service.StartException in service org.camunda.bpm.platform.process-application-module."deployment.camunda-example-invoice-7.10.0.war".START: Exception while invoking the @PostDeploy method
at org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService.invokePostDeploy(ProcessApplicationStartService.java:223)
at org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService.start(ProcessApplicationStartService.java:152)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.camunda.bpm.application.ProcessApplicationExecutionException: java.lang.reflect.InvocationTargetException
at org.camunda.bpm.application.impl.ProcessApplicationLogger.processApplicationExecutionException(ProcessApplicationLogger.java:94)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:120)
at org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService.invokePostDeploy(ProcessApplicationStartService.java:215)
... 9 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService$1.call(ProcessApplicationStartService.java:218)
at org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService$1.call(ProcessApplicationStartService.java:215)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:117)
... 10 more
Caused by: org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of 'UPDATE TaskEntity[0ec55ac9-77ed-11e9-a885-024251084739]' failed. Entity was updated by another transaction concurrently.
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.concurrentUpdateDbEntityException(EnginePersistenceLogger.java:134)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.handleOptimisticLockingException(DbEntityManager.java:498)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.checkFlushResults(DbEntityManager.java:450)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:366)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:324)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:296)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:207)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:136)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:115)
at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:60)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:69)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.TaskServiceImpl.claim(TaskServiceImpl.java:168)
at org.camunda.bpm.example.invoice.InvoiceProcessApplication.startProcessInstances(InvoiceProcessApplication.java:157)
at org.camunda.bpm.example.invoice.InvoiceProcessApplication.startFirstProcess(InvoiceProcessApplication.java:63)
... 17 more
这是我的数据源配置:
<xa-datasource jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngineDS" enabled="true" use-ccm="true">
<xa-datasource-property name="URL">
jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.2.3)(PORT=1551))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=testserv)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=5)(DELAY=3))))
</xa-datasource-property>
<driver>ojdbc7</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<xa-pool>
<is-same-rm-override>false</is-same-rm-override>
<no-tx-separate-pools>true</no-tx-separate-pools>
</xa-pool>
<security>
<user-name>camunda</user-name>
<password>camunda</password>
</security>
<validation>
<background-validation>true</background-validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
</xa-datasource>
如何正确配置数据库?
答案 0 :(得分:1)
Camunda 7.10默认情况下使用Jdbc Batch Processing,该版本可与Oracle 12c或更高版本一起使用。由于您仍在使用Oracle 11g,因此必须设置jdbcBatchProcessing=false
:
另一种配置-jdbcBatchProcessing-设置在将SQL语句发送到数据库时是否必须使用批处理模式。关闭时,语句将一一执行。值:true(默认),false。
批处理的已知问题:
- 批处理不适用于早于12的Oracle版本。
- 在MariaDB和DB2上使用批处理时,jdbcStatementTimeout被忽略。