fjtirado commented on code in PR #1906:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/1906#discussion_r1379839239
##########
data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/storage/AbstractStorage.java:
##########
@@ -84,10 +88,19 @@ public V get(String key) {
}
@Override
- @Transactional
+ @Transactional(REQUIRES_NEW)
public V put(String key, V value) {
- repository.deleteById(key);
- repository.persist(mapToEntity.apply(value));
+ E persistedEntity = repository.findById(key,
LockModeType.PESSIMISTIC_WRITE);
Review Comment:
As discussed, I would add a comment here explaining why we are not using
just merge here.
Reason being that we want to use pessimistic locking just for the update
operation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]