(CI,GC) Fix transactional writes, remove redundant locking.
Description:
The way Core-Plus handles multiple writes of the same entity is incorrect. The reentrant lock was misused and could cause an IllegalMonitorStateException:
"legal.app: An unknown error has occurred. AppException(error=AppError(code=500, reason=Server error., message=An unknown error has occurred., errors=null, debuggingInfo=null, originalException=java.lang.IllegalMonitorStateException), originalException=java.lang.IllegalMonitorStateException) at org.opengroup.osdu.legal.middleware.GlobalExceptionMapper.handleGeneralException(GlobalExceptionMapper.java:133)
OSM provides a mechanism to emit an error when concurrent transactions occur. The service should use this instead of locking threads.
How to test:
via acceptance tests.
Changes include:
-
Refactor (a non-breaking change that improves code maintainability). -
Bugfix (a non-breaking change that solves an issue). -
New feature (a non-breaking change that adds functionality). -
Breaking change (a change that is not backward-compatible and/or changes current functionality).
Changes in:
-
Community Implementation -
GC
Dev Checklist:
-
Added Unit Tests, wherever applicable. -
Updated the Readme, if applicable. -
Existing Tests pass -
Verified functionality locally -
Self Reviewed my code for formatting and complex business logic.
Other comments:
Any comments to approvers here
Edited by Rustam Lotsmanenko (EPAM)