I have two tasks after a parallel gateway, each of the executing a Jasper connector with different jrxml files and the same database configuration. They generate the following exception (complete stack trace at the bottom):
org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
I supposed the two connectors were interfering with each other so I added an event that captures the error and goes to a timer that waits one or two seconds (at random) and goes back to the task to try again.
This workaround is doing ok but I would like to make things right and get these two connectors to work in parallel without errors. I pretend to use this process in a production environment with multiple users and I need to avoid any concurrency errors.
Please help
Complete stack trace:
GRAVE: THREAD_ID=2340 | HOSTNAME=xps12 | TENANT_ID=1 | The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 1657, connectorDefinitionName = Crear Report Evolucion] failed. The failure will be handled.
2015-10-23 20:35:06.140 +0200 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
GRAVE: THREAD_ID=2340 | HOSTNAME=xps12 | TENANT_ID=1 | org.bonitasoft.engine.core.connector.exception.SConnectorException : “PROCESS_DEFINITION_ID=6691142649399358496 | PROCESS_NAME=Test jasper | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=175 | ROOT_PROCESS_INSTANCE_ID=175 | FLOW_NODE_DEFINITION_ID=6029371426308825705 | FLOW_NODE_INSTANCE_ID=1657 | FLOW_NODE_NAME=Generar Evolución | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=Crear Report Evolucion | CONNECTOR_INSTANCE_ID=344 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.”
org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=6691142649399358496 | PROCESS_NAME=Test jasper | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=175 | ROOT_PROCESS_INSTANCE_ID=175 | FLOW_NODE_DEFINITION_ID=6029371426308825705 | FLOW_NODE_INSTANCE_ID=1657 | FLOW_NODE_NAME=Generar Evolución | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=Crear Report Evolucion | CONNECTOR_INSTANCE_ID=344 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:325)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:143)
at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:111)
at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:131)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:128)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:317)
… 14 more
Caused by: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:152)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
… 15 more
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:71)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:208)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:179)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
… 3 more
Caused by: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.executeBusinessLogic(CreateReportFromDataBase.java:213)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:69)
… 6 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:822)
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:839)
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.createJasperReportFromDataBase(CreateReportFromDataBase.java:355)
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.executeBusinessLogic(CreateReportFromDataBase.java:211)
… 8 more