AnsweredAssumed Answered

Database connections stay open

Question asked by ct1 on May 17, 2012
Latest reply on May 18, 2012 by ct1
I have been running some tests intended to simulate multiple user starting processes almost simultaneously.  To simulate the multiple users, I have a program that, for each BPMN process I want launched, starts a new thread which it instantiates a Process Engine, sets the authenticated user id, starts the process instance by id, and destroys its instance of the Process Engine.

The BPMN 2.0 processes get launched (after dealing with the aggravating ActivitiOptimisticLockingException by waiting 5 seconds and trying again, which happend 20% of the time) and run to completion.  However, the database connections remain open.  When I ran 1000 simulated users, over 2000 database connections remained open.  I did not detect a large number of database connections remaining open when I tested with Activiti Explorer's launching processes, only when I used the Java API to the Process Engine.

It seems that applications that open database connections are responsible for closing them. 

Does the code explicitly close the connections? 
If not, is there a configuration parameter on the Engine that controls the closing of database connections? 
Or, is there something in the API that would let me request the connections be closed?

Thank you.