On DBS when the session is not saved a call to TransactionHelper.commitOrRollback might return without throwing an error while nothing has been committed on the backend.
In this specific case, the transaction manager (geronimo) is performing the backend request during an afterCompletion hook, if there is an error (like concurrent exception) it is traced as a WARN and not propagated.
Here an example of such case:
2021-10-06T21:05:24,761 WARN [Transaction] Unexpected exception from afterCompletion; continuing org.nuxeo.ecm.core.api.ConcurrentUpdateException: E11000 duplicate key error collection: nuxeo.default index: ecm:id_1 dup key: { ecm:id: "0816c2c2-db01-5989-ab83-06bd1da46ebb" }, Concurrent update at org.nuxeo.ecm.core.storage.mongodb.MongoDBRepository.createStates(MongoDBRepository.java:562) ~[nuxeo-core-storage-mongodb-10.10-HF49.jar:?] at org.nuxeo.ecm.core.storage.dbs.DBSCachingRepository.createStates(DBSCachingRepository.java:217) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?] at org.nuxeo.ecm.core.storage.dbs.DBSTransactionState.save(DBSTransactionState.java:824) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?] at org.nuxeo.ecm.core.storage.dbs.DBSTransactionState.commit(DBSTransactionState.java:1129) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?] at org.nuxeo.ecm.core.storage.dbs.DBSSession.commit(DBSSession.java:245) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?] at org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase$TransactionContext.afterCompletion(DBSRepositoryBase.java:481) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?] at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:540) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:533) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:329) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) ~[nuxeo-runtime-jtajca-10.10-HF41.jar:?] at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:422) ~[nuxeo-runtime-jtajca-10.10-HF41.jar:?]
The workaround is to make sure the session is saved Session#save before commit.
- is related to
-
NXP-30652 DBS rollback should not remove existing document
- Open