couchbase / couchbase-transactions-dotnet Goto Github PK
View Code? Open in Web Editor NEWDistributed Transactions for Couchbase, .NET API
License: Apache License 2.0
Distributed Transactions for Couchbase, .NET API
License: Apache License 2.0
The binary in the Nuget package labeled as v1.0.0 does not match the latest commit in Master, nor is there any label indicating which code commit was the most recent at the time the binary was built. This makes debugging the code harder.
I'm getting an error message indicating a problem in the "GetWithMavAsync" function, but that function has since been renamed. What else has changed?
Hi everyone,
I'm facing an issue while inserting simultaneously multiple documents in couchbase, using transactions.
What I have read on the couchbase documentation (batching paragraph) is to instantiate a Task for each insertion and wait for the completion of all of them (as documented here)
If I try to execute many inserts in a batch (by instantiating multiple tasks) without using transactions everythings works fine, but when I call the InsertAsync method from the AttemptContext object, an exeception will randomly be thrown.
Here I've created a repository where you can reproduce the error.
You can find the stack trace listed below:
Couchbase.Transactions.Error.TransactionFailedException: Transaction failed.
---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Couchbase.Transactions.AttemptContext.InsertAsync(ICouchbaseCollection collection, String id, Object content)
at TransactionBulkInsert.Program.<>c__DisplayClass7_1.<b__0>d.MoveNext() in C:\Users\user\source\repos\TransactionBulkInsert\Program.cs:line 73
--- End of stack trace from previous location where exception was thrown ---
at Couchbase.Transactions.Transactions.ExecuteApplicationLambda(Func`2 transactionLogic, TransactionContext overallContext, ILoggerFactory loggerFactory, TransactionResult result)
--- End of inner exception stack trace ---
at Couchbase.Transactions.Transactions.RunAsync(Func`2 transactionLogic, PerTransactionConfig perConfig)
at TransactionBulkInsert.Program.SaveBatch() in C:\Users\user\source\repos\TransactionBulkInsert\Program.cs:line 64
-----------------------Context Info---------------------------
null
Examining the source code I suppose is something related to _stagedMutations property of AttempContext class. In particular seems that the exception was thrown at line 424 when searching for staged mutations while another task may have changed the same collection.
Currently I'm using these nuget packages:
and Couchbase Server Community v.6.6.0
Do you have any suggestion?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.