Correct way to update a BDM record from multiple concurrent processes?

1
0
-1

It may be that I have structured my application badly; but I am am seeing errors during high-load testing which seem to suggest that the problem is that a BDM record is being updated by two processes at the same time in such a way that one of them barfs. The error is typically ...

org.hibernate.StaleObjectStateException.: Row was updated or deleted by another transaction

So my question .. is there a right way of doing this in a manner that prevents these inter-process issues? I guess I'm looking for some kind of implicit record locking or synchronization.

Thanks

Comments

Submitted by chris.lowth on Sat, 03/11/2017 - 00:20

Ok - I've cracked it (albeit: it's rather a hack) - Community edition, 7.3.2.

In case anyone is having the same challenge: the following might be of use..

Changing the "executeTransactionContent" function in ProcessAPIImpl.java into a "synchronized" one seems to fix the problem rather nicely and gets round the issue. When I found this, I assumed it would have a negative impact on performance - but my tests dont actually reveal any change at all - at least: not on my test data set.

--

The usual disclaimer:- you make this change 100% at your own risk. All I can say is that it SEEMS to work for MY application and test dataset TODAY. Testing and confirming the hack in your own environment is your own responsibility.

No answers yet.
Notifications