mongo-java-server
mongo-java-server copied to clipboard
Feature/transactions
#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.
Coverage decreased (-0.2%) to 96.757% when pulling 8c0f227a7e1bfc2c6f59e33ec402a2e99ec88051 on snava10:feature/transactions into 13059bec7594accbca82ed6359be63d89b039d48 on bwaldvogel:master.
@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 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