We are running Camunda Engine on Centos 7.5 with Postgresql.
We got this error randomly:
SEVERE [http-nio-8081-exec-9] org.camunda.commons.logging.BaseLogger.logError 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: org.postgresql.util.PSQLException: This connection has been closed.
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/HistoricProcessInstance.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity.selectHistoricProcessInstanceCountByQueryCriteria
### 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: org.postgresql.util.PSQLException: This connection has been closed.
@Abu_Man have you configured the connection pool settings? maybe a solution would be to use a connection pool which has a keep-alive option for connections. I think the problem is that inactive connections are closed by the server and this leads to this problems.
protected void setDesiredAutoCommit(boolean desiredAutoCommit) {
try {
if (connection.getAutoCommit() != desiredAutoCommit) {
if (log.isDebugEnabled()) {
log.debug("Setting autocommit to " + desiredAutoCommit + " on JDBC Connection [" + connection + "]");
}
connection.setAutoCommit(desiredAutoCommit);
}
} catch (SQLException e) {
// Only a very poorly implemented driver would fail here,
// and there's not much we can do about that.
throw new TransactionException("Error configuring AutoCommit. "
+ "Your driver may not support getAutoCommit() or setAutoCommit(). "
+ "Requested setting: " + desiredAutoCommit + ". Cause: " + e, e);
}
}
Hi,
we run camunda 7.13 docker image in Openshift with postgres 10 database
and experienced the same issue.
We fixed it in same way as @Olivier_Albertini did but in containerized way:
adding DB_VALIDATE_ON_BORROW=true to container environment.
same problem with camunda 7.14, with MariaDB up to date on virtual machine (with the isolation level READ_COMMITTED).
Applying settings like @Olivier_Albertini fixes issue for us. I tested it after by provoking the same error to test the solution.