Database
5 results found
-
XA Support
Is there any plan to implement distributed transaction that involves more than one data stores (for e.g. an RDBMS and Mongo)? We have one such requirement and tried a simple POC by creating a simple class extending XAResource (MongoXAResource implements XAResource) and overriding below methods.
@Override
public void commit(Xid xid, boolean b) throws XAException {
clientSession.commitTransaction();
}@Override
public void rollback(Xid xid) throws XAException {
clientSession.abortTransaction();
}It appears to work but i think there is a lot more to do. Is there any plan to implement by MongoDB team?
49 votes -
Lock on session start level with provided keys
Scenario:
Parallel DB updates with transactions on multiple collections that use same documents.
Example: Calculate some common stuff to embed it in extra collections to avoid lookups.Problem:
Lock and timeout on documents uses up valuable time and performance.
Also lock conflicts produce a huge amount of exceptions that need to be handled.Idea:
Key-based sessionsExample:
Session A with Keys 1 and 2 is started.
Session B tries to start with Key 1. Key 1 is locked with Session A. Session B waits till Session A is finished.In this case transaction doesn't start with updating and failing. Waiting…
7 votes -
Cascading delete for DBRefs
Since transactions have been added in 2018, which work across collections (https://www.mongodb.com/docs/manual/core/transactions/) and across shards (https://www.mongodb.com/docs/manual/core/transactions-sharded-clusters/), shouldn't cascading deletes be possible now? I only worked with sql transactions in the past, but my intuition would be that it should be fairly easy to do this in a client:
- start a transaction
- fetch document
- look for dbref fields
- fetch those docs
- continue at 2 until all docs have been found, stopping at branches when a doc has already been fetched
- go back in reverse and delete all of them
- commit transaction
If this is possible to do…
2 votes -
Support for Transaction Savepoints (Nested Transactions)
The ability to partially rollback transactions to a specified point.
2 votes -
Lock the document field (not the entire document)
Hi
according to this reference: https://www.mongodb.com/blog/post/how-to-select--for-update-inside-mongodb-transactionsWhen I lock a document with a field with a new ObjectID, the whole document is locked!
Idea :
Operations:
i have three fields : A , B , C
I locked fieldA
with new ObjectID in transactionT1
.
i locked fieldB
with new ObjectID in transactionT2
.Behaviors (high performance) :
- In transactionT2
: if fieldA
is updated,writeConflict
error occurs.
- In transactionT1
: if fieldB
is updated,writeConflict
error occurs.
- Outside of transactions: If fieldA
is updated, it waits for …1 vote
- Don't see your idea?