Camunda stops working when SQL server has been rebooted


#1

Dear all, I am very new to Camunda so please bear with me if my questions are stupid.

This is what I see. When rebooting the back-end SQL server, the front-end webserver stops working and throws an internal server error 500. To fix it, I must restart the apache tomcat service…
What I see in the stderr-log is this:
"jun 29, 2017 10:51:05 AM org.camunda.commons.logging.BaseLogger logError
SEVERE: ENGINE-16004 Exception while closing command context:

Error querying database. Cause: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit. Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: java.sql.SQLException: Invalid state, the Connection object is closed.

The error may exist in org/camunda/bpm/engine/impl/mapping/entity/User.xml

The error may involve org.camunda.bpm.engine.impl.persistence.entity.UserEntity.selectUserCountByQueryCriteria

The error occurred while executing a query

Cause: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit. Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: java.sql.SQLException: Invalid state, the Connection object is closed.

org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit. Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: java.sql.SQLException: Invalid state, the Connection object is closed.

The error may exist in org/camunda/bpm/engine/impl/mapping/entity/User.xml

The error may involve org.camunda.bpm.engine.impl.persistence.entity.UserEntity.selectUserCountByQueryCriteria

The error occurred while executing a Query

Checking this error (autocommit one) led me to add testonborrow=“True” to the server.xml under the jdbc/ProcessEngine resource… However, this did not help.
If I restart the Apache tomcat service, everything works as normal again, but surely this should not be necessary?

Does anyone have a clue what I can do to fix this?


#2

Try this in server.xml and replace the sql queries with one that gives a result from the sql server in your case


#3

Thanks :D.

Added it, but I used the following validationquery: SELECT 1. Maybe that is not correct?

Anyways, the result is the same as before. Rebooting the SQL-server results in the Camunda server going nuts and throwing the following when I try to access the login page: HTTP Status 500 - org.camunda.bpm.engine.ProcessEngineException: Process engine persistence exception.

Here is what I put in:

And this is what the processengine resource looks like:


#4

Update:
Just mixed your settings with my already existing processengine resource settings, and it was a success :D. I can now reboot the SQL server and Camunda responds as usual after SQL is available again.

Thank you very much for helping @Tristan1 :smiley:


#5

Could you please post the settings that work for you? That would help other users with the same problem.


#6

Good idea, @thorben :D.

Here are the settings that proved working for us:


#7

One more question, @Tristan1: In our original server.xml we had the minIdle=“5” present. In your fix, there is no minIdle but a maxIdle. Could that cause any problems?


#8

In tomcat server.xml I add the following config under Resource name=“jdbc/ProcessEngine” to solve the problem:

Adding:
validationQuery=“SELECT 1”
validationInterval=“34000”
testOnBorrow=“true”