cancel
Showing results for 
Search instead for 
Did you mean: 

Activit DB Connection pool leak on WL

schitale
Champ on-the-rise
Champ on-the-rise
I didnt get any answer on activiti engine forum for this:

I see this multiple times in the WL log:

ACTIVITI_DB_POOL is the conn pool we use to connect to activit engine.

<Sep 24, 2013 7:39:10 PM EDT> <Notice> <Stdout> <BEA-000000> <Returning ALBPM JDBC Connection ….>
<Sep 24, 2013 7:39:23 PM EDT> <Warning> <JDBC> <BEA-001153> <Forcibly releasing inactive connection "weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@17a3db" back into the connection pool "ACTIVITI_DB_POOL", currently reserved by: java.lang.Exception
        at weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:308)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:314)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:292)
        at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:425)


I also keep getting this error all the time. What exactly is going wrong, I'm not sure? (Are the two stack traces related some how?)

I'm using WL datasource with JTA transaction.

WARNING: Exception or error caught in resource
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: Connection has already been closed.
### SQL: insert into ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.sql.SQLException: Connection has already been closed.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:137)
at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:538)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:441)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:169)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:116)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:70)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.TaskServiceImpl.complete(TaskServiceImpl.java:167)
at org.activiti.rest.api.runtime.task.TaskResource.completeTask(TaskResource.java:131)
at org.activiti.rest.api.runtime.task.TaskResource.executeTaskAction(TaskResource.java:80)

Caused by: java.sql.SQLException: Connection has already been closed.
at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:55)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:482)
at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:239)
at com.sun.proxy.$Proxy73.prepareStatement(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:72)
at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:82)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:54)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:70)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:44)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:100)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:1
14 REPLIES 14

frederikherema1
Star Contributor
Star Contributor
You can use any datasource/pool you want with activiti, nothing is done in activiti to fix any leaks, as this is not in the scope of the engine. The engine just gets connections from the pool and releases them…

viresh_managool
Champ in-the-making
Champ in-the-making
hello,

Even we are facing same issue with respect to oracle DB. We have configured the following settings in hibernate.cfg.xml, but still we are facing connections leak.

<code>
                <property name="hibernate.c3p0.min_size">5</property>
  <property name="hibernate.c3p0.max_size">100</property>
  <property name="hibernate.c3p0.timeout">300</property>
  <property name="hibernate.c3p0.max_statements">50</property>
  <property name="hibernate.c3p0.idle_test_period">3000</property>
</code>

for actual issue thread please check the following link:
http://forums.activiti.org/content/database-server-crash

jorell
Champ in-the-making
Champ in-the-making
Was anyone able to resolve this issue? We are using c3p0 and occasionally (once a weak) end up with 'hung' threads on awaitAvailable. No error or exceptions in the logs basically all threads are waiting on a db query.

pksahoo
Champ in-the-making
Champ in-the-making
hi,

How can I configure receive task and signal in Activiti?
use a receive-task and trigger the long-running work in another system/app. once that app completes the operation, "signal" activiti, providing the result of the operation. Than, activiti can continue the process

jbarrez
Star Contributor
Star Contributor
This has absolutely nothing to do with the original post here …