You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Programmatix datacouch 1145 transaction support (#1446)
* Porting to SDK-integrated version of transactions
The transactions logic exists in the Java SDK as of 3.3.0,
with a slightly different API.
This is the first effort at the port, which literally just
compiles. It will not run as crucial code has been
commented and todo-ed. There is work remaining to figure
out how to complete the port, as some crucial parts (such
as ctx.commit() and ctx.rollback()) have been intentionally
removed.
* Continuing work to get the ExtSDKIntegration port working
Trying to transition to CallbackPreferring manager.
* Added CouchbaseSimpleCallbackTransactionManager, the simplest
possible implementation of CallbackPreferringTransactionManager,
combined with a simpler approach to ThreadLocal storage in
ReactiveInsertByIdSupport.
Test 'commitShouldPersistTxEntriesOfTxAnnotatedMethod' is now
passing.
* Adding WIP get-and-replace @transactional support
(Not yet working as CAS/version field in
Person is not populated correctly.)
* Transitioning to use CoreTransactionAttemptContext.
Tests may fail.
* Removing AttemptContextReactiveAccessor
Don't think we need this, as we can pass around
CoreTransactionAttemptContext instead, which gives
access to a lot of internals.
* Removing TransactionsReactive
Would prefer not to C&P a huge class out of the transaction
internals, and don't think we need it.
* Removing some files not currently used
To reduce & simplify the amount of code to look at.
Some don't seem to be used in any branch, some just
aren't used in this branch.
* Removing CouchbaseTransactionInterceptor
As per offline discussion, CallbackPreferringPlatformTransactionManager
is perhaps the optimal solution.
* Copying @transactional tests out into separate class
* Tidyup
* Tidyup test names
* Verify GenericSupport is on same thread before and after transactional operation
* Refactoring CouchbaseSimpleCallbackTransactionManager ThreadLocalStorage management
* Using latest java-client
* ReactiveReplaceByIdSupport - Fixing use of CAS now have CoreTransactionAttemptContext.
Removing unused code.
* ReactiveInsertByIdSupport - fixing use of reactive vs non-reactive, and CAS
* Merging upstream
* Remove incorrect thread check (.doOnNext could execute on a different thread)
* Completing merge from upstream
* Removing unused classes
* Give GenericSupport a better name
* Reject at runtime options that aren't supported in a transaction
* Fixing some small todos, partly by removing unused coe
* Fix runtime option checks
* Simplifying CouchbaseSimpleCallbackTransactionManager ThreadLocalStorage
Standardising on ReactiveCouchbaseResourceHolder rather than
holding CoreTransactionAttemptContext too
* Removing version from CouchbaseDocument
Can't recall why I added this, and tests pass without it
* Improving CouchbaseTransactionalIntegrationTests and adding more tests
* Reject operations that aren't allowed in a transaction (upsertById etc.)
* Improve handling of CAS mismatch
By calling CoreTransactionAttemptContext.operationFailed,
it ensures that internal state is set. So even if
the user catches the exception, the transaction still behaves
as it should.
* Removing a now-redundant non-transactional check on upsertById
I missed this when adding TransactionalSupport.verifyNotInTransaction
here.
* Support @transactional options timeout and isolation level
Co-authored-by: Graham Pople <[email protected]>
// todo gpx these would be per-transactions options so it seems odd to have a global bean? Surely would want to configure everything at global level instead?
380
376
@Bean
381
377
publicTransactionOptionstransactionsOptions(){
382
378
returnTransactionOptions.transactionOptions();
383
379
}
384
380
381
+
// todo gpx transactions config is now done in standard ClusterConfig - so I think we don't want a separate bean?
0 commit comments