cancel
Showing results for 
Search instead for 
Did you mean: 

Does Activiti need new db connection for each separate workflow?

alper
Champ in-the-making
Champ in-the-making
Hi,
First of all, I found Activiti pretty impressive in part of performance when I became more or less educated in the workflow technology and BPMN. Thanks for that.
But there is a thing that I didn't find workaround for without giving up the performance.
In my tests I see that if I launch new separate instance of my workflow on the same engine, Activiti opens a brand-new connection to the database.
It wouldn't be a problem if I were launching tens of concurrent instances.
But for my purposes I need to launch thousands of them concurrently, and for each of them Activiti needs an immediate connection to the DB.
I have pooling enabled in my jboss, but if its max size is less than the number of simultaneous processes I need to launch, some processes exit with db timeout exception, which means that internal pool queue is not a solution here.
If I increase the max pool size to 1000 connections, my Oracle freezes in dismay, so I can not believe it's the right thing to do in this situation.

I am aware that Oracle can do that being installed on more powerful machines, with RAIDs or SSD, but… I need the guaranteed safety from such timeouts.

Maybe I do things in a wrong way? maybe there are some configuration tips that allow to use connection more wisely?
I appreciate any help.

Thank you.
3 REPLIES 3

trademak
Star Contributor
Star Contributor
There's no magical solution for this problem. Connection pooling is definitely the area to focus on. Also, you could try to keep the transaction to start a new process instance as short as possible. This would be possible to using asynchronous tasks for example.

Best regards,

alper
Champ in-the-making
Champ in-the-making
As it is impossible to make the whole process asynchronous from the start, I make the first activity asynchronous to transfer the whole process to the asynchronous mode as soon as possible.
Is that what you mean?

Also, maybe you can give me a piece of advice how to tune the connection timeout in the Activiti Engine to make the pool's queue  useful in this situation? Though it is definitely a half-measure…

trademak
Star Contributor
Star Contributor
Yes that's what I mean indeed.
I don't think the connection timeout needs special tweaking for Activiti.

Best regards,