JanssenProject / JanssenProject/jans
feat(jans-core): add Application-level transactions support
- Dominant language
- Java
- Stars
- 648
- Forks
- 174
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 110
Description
Few server nodes can update entries like statistic/cache/MAU simultaneously. As result this might led to data unsync.
There are few approach to grantee that node updated entry correctly. Transactions helps to resolve this issue but this will led to performance decreases and can led to deadlocks, etc.
**Optimistic Locking**
We have an additional version column. The version column is incremented every time an UPDATE or DELETE is executed, and it is also used in the WHERE clause of the UPDATE and DELETE statements. For this to work, we need to issue the SELECT and read the current version prior to executing the UPDATE or DELETE, as otherwise, we would not know what version value to pass to the WHERE clause or to increment.

Another approach is to do this with **Application-level transactions**

ORM should support application level transactions:
1) Add mew property @Version to specify which column will be used
2) Add new method updateWithVersion
Contributor guide
Assessment
This issue has not been assessed yet.