-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure database isolation level is correctly set #4516
Comments
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
…on datasource initialisation Related to #4516
Manual testingTomcatDatasource config in <Resource name="jdbc/ProcessEngine"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
uniqueResourceName="process-engine"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/process-engine"
defaultTransactionIsolation="SERIALIZABLE"
username="camunda"
password="camunda"
maxActive="20"
minIdle="5"
maxIdle="20" /> Default
`skipIsolationLevelCheck` set to `true`
WildFly 33Datasource config in <datasource jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngine" enabled="true" use-java-context="true" jta="true" use-ccm="true">
<connection-url>jdbc:postgresql://localhost:5432/process-engine</connection-url>
<driver>postgresql</driver>
<transaction-isolation>TRANSACTION_READ_UNCOMMITTED</transaction-isolation>
<security user-name="camunda" password="camunda"/>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql" />
</drivers> Default
`skipIsolationLevelCheck` set to `true`
Spring BootDatasource config in spring.datasource:
username: camunda
password: camunda
url: jdbc:postgresql://localhost:5432/process-engine
driver-class-name: org.postgresql.Driver
hikari:
transaction-isolation: "TRANSACTION_REPEATABLE_READ" Default
`camunda.bpm.generic-properties.properties.skip-isolation-level-check: true`
|
Handover Dev 2 QAI have already tested Spring Boot, WildFly, and Tomcat. Maybe we can focus for the QA test on more exotic setups like WebLogic, WebSphere? |
So I have tried this on this setup:
<dataSource
id="CamundaBpmDataSource"
jndiName="jdbc/ProcessEngine"
type="javax.sql.ConnectionPoolDataSource"
isolationLevel="TRANSACTION_READ_COMMITTED">
<jdbcDriver
javax.sql.DataSource="org.postgresql.jdbc3.Jdbc3ConnectionPool"
libraryRef="Camunda" />
<properties
serverName ="localhost"
portNumber = "5432"
databaseName = "process-engine"
user="camunda"
password="camunda" />
</dataSource>
docker run -it --rm \
--name=postgres13 \
-p 5432:5432 \
-e POSTGRES_DB=process-engine \
-e POSTGRES_PASSWORD=camunda \
-e POSTGRES_USER=camunda \
postgres:13.2 And everything comes up fine (video) and on the logs I can't find the error code for the isolation db error/the engine comes up fine, is this expected? as we are looking for "READ_COMMITTED" + engine should stop working |
Hi @gbetances089, what happens if you change Using the first one forces the database to use Best, |
Now after updating the iso level, I got the error and engine stopped. <dataSource
id="CamundaBpmDataSource"
jndiName="jdbc/ProcessEngine"
type="javax.sql.ConnectionPoolDataSource"
isolationLevel="TRANSACTION_SERIALIZABLE">
<jdbcDriver
javax.sql.DataSource="org.postgresql.jdbc3.Jdbc3ConnectionPool"
libraryRef="Camunda" />
<properties
serverName ="localhost"
portNumber = "5432"
databaseName = "process-engine"
user="camunda"
password="camunda" />
</dataSource>
```xml
[9/16/24, 10:10:48:159 CEST] 00000037 com.ibm.ejs.container.BusinessExceptionMappingStrategy E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "start" on bean "BeanId(camunda-bpm-platform#camunda-ibm-websphere-service.jar#BpmPlatformBootstrap, null)". Exception data: org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing 'deploying Camunda Platform' => 'Start process engine default': ENGINE-12019 The transaction isolation level set for the database is 'SERIALIZABLE' which differs from the recommended value. Please change the isolation level to 'READ_COMMITTED' or set property 'skipIsolationLevelCheck' to true. Please keep in mind that some levels are known to cause deadlocks and other unexpected behaviours.
at org.camunda.bpm.container.impl.ContainerIntegrationLogger.exceptionWhilePerformingOperationStep(ContainerIntegrationLogger.java:316)
at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:136)
at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:160)
at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:216)
at org.camunda.bpm.container.impl.ejb.EjbBpmPlatformBootstrap.start(EjbBpmPlatformBootstrap.java:76)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:200)
at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:585)
at com.ibm.ejs.container.interceptors.InvocationContextImpl.doLifeCycle(InvocationContextImpl.java:326)
at com.ibm.ejs.container.SingletonBeanO.callTransactionalLifecycleInterceptors(SingletonBeanO.java:221)
at com.ibm.ejs.container.SingletonBeanO.initialize(SingletonBeanO.java:307)
at com.ibm.ejs.container.BeanOFactory.create(BeanOFactory.java:103)
at com.ibm.ejs.container.EJSHome.createSingletonBeanO(EJSHome.java:3483)
at com.ibm.ejs.csi.EJBApplicationMetaData.createStartupBeans(EJBApplicationMetaData.java:1001)
at com.ibm.ejs.csi.EJBApplicationMetaData.startedModule(EJBApplicationMetaData.java:735)
at com.ibm.ws.ejbcontainer.osgi.internal.EJBRuntimeImpl.start(EJBRuntimeImpl.java:1132)
at com.ibm.ws.ejbcontainer.osgi.internal.EJBModuleRuntimeContainerImpl.startModule(EJBModuleRuntimeContainerImpl.java:164)
at com.ibm.ws.app.manager.module.internal.ModuleHandlerBase.deployModule(ModuleHandlerBase.java:99)
at com.ibm.ws.app.manager.module.internal.DeployedModuleInfoImpl.installModule(DeployedModuleInfoImpl.java:49)
at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.deployModules(SimpleDeployedAppInfoBase.java:597)
at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:511)
at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:349)
at com.ibm.ws.app.manager.ear.internal.EARApplicationHandlerImpl.install(EARApplicationHandlerImpl.java:77)
at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:182)
at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1367)
at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:910)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:245)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-12019 The transaction isolation level set for the database is 'SERIALIZABLE' which differs from the recommended value. Please change the isolation level to 'READ_COMMITTED' or set property 'skipIsolationLevelCheck' to true. Please keep in mind that some levels are known to cause deadlocks and other unexpected behaviours.
```
After setting the new property in the bpm-platform.xml file:
Other logs that I found where:
|
Related to camunda/camunda-bpm-platform#4516 Backported commit d479f3bc3e from the camunda-bpm-platform repository. Original author: Joaquín <165814090+joaquinfelici@users.noreply.github.com>
For Springboot 'camunda.bpm.generic-properties.properties.skip-isolation-level-check: true' only can skip init process,but when use the web app, do query operation,the method "initFromProcessEngineConfiguration" of "QuerySessionFactory" not use the arg 'processEngineConfiguration' to setting the prop of 'skipIsolationLevelCheck',then throw a exception. |
Hello @disperDuan! Thanks for bringing this up, I'll look into this and let you know if a fix is needed. |
Hello @disperDuan , I confirm the issue you mention. I raised #4867 to track it and I'll fix it soon. |
User Story (Required on creation)
As a user, I want an error to be thrown if the transaction isolation level configured for the database is not correct and to be able to skip this check to be able to set a custom level even if it's not optimal.
Functional Requirements (Required before implementation)
Technical Requirements (Required before implementation)
Requirements
On engine initialisation, the transaction isolation level for a Connection will be checked, and we'll have the following scenarios:
Limitations of Scope
Hints
Links
Breakdown
Pull Requests
Dev2QA handover
The text was updated successfully, but these errors were encountered: