mongo-java-server icon indicating copy to clipboard operation
mongo-java-server copied to clipboard

Feature/transactions

Open snava10 opened this issue 4 years ago • 3 comments

#143

Includes basic support for transactions (updates and find operations to start with). Implemented on top of H2 transactions, so it is only available for the H2 Backend. Real mongo test of transactions using a replica set.

snava10 avatar Dec 24 '20 12:12 snava10

Coverage Status

Coverage decreased (-0.2%) to 96.757% when pulling 8c0f227a7e1bfc2c6f59e33ec402a2e99ec88051 on snava10:feature/transactions into 13059bec7594accbca82ed6359be63d89b039d48 on bwaldvogel:master.

coveralls avatar Dec 24 '20 12:12 coveralls

@snava10: Thanks for this large contribution. I really appreciate your work!

However, adding H2 as dependency to core and even exposing the H2 classes in the core API is going in the wrong direction. I think we would need to hide the transaction implementation details behind some session/transaction facade that will then be implemented in the H2 backend. It would throw an UnsupportedOperationException in the other backends or even "silently" ignore start/commit transaction requests if the user explicitly wants it.

However, please also see my comment on why I even think that supporting transactions could be out-of-scope for this project. Please convince me that I’m wrong! :)

bwaldvogel avatar Apr 11 '21 15:04 bwaldvogel

@bwaldvogel I agree with you regarding H2 in the core module. This pull request needs some serious refactoring, I lack the time at the moment, I'll come back to it when I can, or maybe someone else wants to contribute

snava10 avatar Apr 13 '21 10:04 snava10