Hi, I am using activiti 5.17.0 and trying to implement my own job executor by extending org.activiti.engine.impl.jobexecutor.JobExecutor, but ended up getting UniversalConnectionPoolException while executing the jobs. Seems like if there are many jobs simultaneously running then this issue is coming. If I am not using any job executor, this exception is not coming. Can anyone throw some light on this one.
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: All connections in the Universal Connection Pool are in use at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241) at org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:424) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:348) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) at org.activiti.engine.impl.jobexecutor.FailedJobListener.execute(FailedJobListener.java:47) at org.activiti.spring.SpringTransactionContext$4.afterCompletion(SpringTransactionContext.java:97) at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168) <code>
Please check your pool settings and the amount of connections you can create with your database user. The job executor needs a number of database connections to execute the SQL statements.
I decreased the values to be equal to ucp connection pool properties but I get the same exception. <code> <bean id="customJobExecutor" class="com.uprr.bpm.activiti.custom.CustomJobExecutor"> <property name="queueSize" value="5"></property> <property name="corePoolSize" value="5"></property> <property name="maxPoolSize" value="50"></property> <property name="keepAliveTime" value="0"></property> </bean> </code>
Below are my ucp pool configuration. The min-pool-size = 5 and max-pool-size = 50 <code> <ucpool-manager id="ncs.ucp.manager.bpe.enpr"> <ucpooled-datasource id="ncs.ucp.datasource.bpe.enpr" url="<some url>" fast-connection-failover-enabled="true" initial-pool-size="5" max-pool-size="50" min-pool-size="5" max-statements="5" validate-connection-on-borrow="true" inactive-connection-timeout="10" /> </ucpool-manager> </code>