Skip to content

Database

To report bugs, please use our SERVER JIRA project.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback

5 results found

  1. 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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  2. 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 sessions

    Example:
    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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  3. 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:

    1. start a transaction
    2. fetch document
    3. look for dbref fields
    4. fetch those docs
    5. continue at 2 until all docs have been found, stopping at branches when a doc has already been fetched
    6. go back in reverse and delete all of them
    7. commit transaction

    If this is possible to do…

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. Support for Transaction Savepoints (Nested Transactions)

    The ability to partially rollback transactions to a specified point.

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Transactions  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  5. 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-transactions

    When 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 field A with new ObjectID in transaction T1.
    i locked field B with new ObjectID in transaction T2.

    Behaviors (high performance) :
    - In transaction T2: if field A is updated, writeConflict error occurs.
    - In transaction T1: if field B is updated, writeConflict error occurs.
    - Outside of transactions: If field A is updated, it waits for …

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Transactions  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  • Don't see your idea?

Feedback and Knowledge Base