cancel
Showing results for 
Search instead for 
Did you mean: 

ACT_GE_BYTEARRAY table records getting deleted

tauseefjanvekar
Champ in-the-making
Champ in-the-making
We have strangely observed that records in ACT_GE_BYTEARRAY table have been deleted for few process instance ids.
I am not sure how can this happen without any delete api being called.

Observations:
1. All the process instances for which this problem is found have completed their lifecycle.
2. there are other process instances that have completed their life cycle but bytearray ids are present.

Please help.

4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Tas,

All runtime variables (it  includes variables stored in ACT_GE_BYTEARRAY) should be deleted when process instance is finished.
Could you reproduce the issue in the jUnit test please?

http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

tauseefjanvekar
Champ in-the-making
Champ in-the-making
Hi Martin,

Thanks for your response.

I agree that all runtime variables should get deleted when process instance is finished.
But I guess the ACT_GE_BYTEARRAY variables do not get deleted when any process instance is completed.
We are using a older version of Activiti 5.14.

Actually we are tracking processes that have completed and we need to show what values we used when the process instance completed.
We are getting this information from ACT_HI_VARINST table. But for few BYTEARRAY_IDs the object returned is null because the value is not present in ACT_GE_BYTEARRAY table.

If I upgrade to higher version and the ACT_GE_BYTEARRAY table entries get deleted after I complete a process, Is there a way I can get reference to the bytearray ids that the completed process instance id used.

Thanks,
Tas.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Tas,

Exactly as you said, You should be able to get process instance variables from History. (e.g. org.activiti.standalone.history.FullHistoryTest#testVariableUpdatesThe described behavior is strange. Could you recognize which variables are lost? (jUnit test?)

Regards
Martin

tauseefjanvekar
Champ in-the-making
Champ in-the-making
Hi Martin,

We finally found out the root cause.

If we try to insert a value in ACT_HI_VARINST that already present then this issue happens.
Example we have a variable with id 12345 that has an associated bytearray_id = 123456 in both active and history table.
HI_VARINST_ID=12345.
HI_VARINST_BYTEARRAY_ID=123456.
RU_VARIABLE_ID=12345.
RU_VARIABLE_BYTEARRAY_ID=123456.

When we try to set a different value to this variable then activiti tries to insert the active record into history table, but as the record already exists, activiti strangely deletes the GE_BYTEARRAY record with ID=123456.

Coming to the reason why we had history and active variable table with the same id - We had given a datafix to restore few variables from history table but forgot to delete the history table record

Thanks.