-
In my project, there are currently a few services which use JACIS transactions to manipulate data stored in multiple
Are there any other options for dealing with this issue? Edit: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Generally retrying the whole transaction is the solution for stale object exceptions when using optimistic locking (similar e.g. in hibernate...). I also always use a helper class starting the transaction, executing a task and finally committing the transaction. This helper class also cares about the retry. The helper class looks similar to your suggestion (I usually add an increasing delay between the retries). I implemented the helper class outside the store since I usually use it with global JTA transactions and the helper class is more general. Anyway I will think about adding a helper class (or method) doing the same for local transactions... |
Beta Was this translation helpful? Give feedback.
Generally retrying the whole transaction is the solution for stale object exceptions when using optimistic locking (similar e.g. in hibernate...). I also always use a helper class starting the transaction, executing a task and finally committing the transaction. This helper class also cares about the retry. The helper class looks similar to your suggestion (I usually add an increasing delay between the retries). I implemented the helper class outside the store since I usually use it with global JTA transactions and the helper class is more general.
Anyway I will think about adding a helper class (or method) doing the same for local transactions...
See: #28 (comment)