cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles with remove unnecessary operations while flush

dooman
Champ in-the-making
Champ in-the-making
Hello.

In my case I have business process that has callActivity. In some way subrocess ends in transaction where it was created. And when activiti flush transaction I see errors in database (incorrect foreign keys). That occurs because DbSqlSession.flushTransaction() calls removeUnnecessaryOperations(). This method removes INSERTs and DELETEs, but it doesn't delete variables assotiated with the execution. Foreign keys check in java code is very heavy task and I think hack sql operations is not good approach. Сan I create an option that will be turn off this optimization and create patch for trunk?
2 REPLIES 2

ptrepag
Champ in-the-making
Champ in-the-making
I also have an issue where in a certain scenario, I have a create task listener that tries to immediately complete the task.  The call to removeUnnecessaryOperations does not do the task insert, and then the identity links which were not removed create a foreign key error.

ptrepag
Champ in-the-making
Champ in-the-making
I got around my problem by calling flush on dbsqlsession before completing the task.  Is it OK to call flush from within a event listener?  I looked at the code and all it seems to do is just execute the pending database statements and leave the current transaction alone.  With this being the case, I am assuming that flush can safely be called.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.