Skip to content

Add MongoDB transactions support #26

@anitnilay20

Description

@anitnilay20

Description

Implement MongoDB multi-document transactions with proper error handling and retry logic.

Requirements

  • Multi-document transaction support
  • Transaction retry logic
  • Read/write concerns configuration
  • Session management
  • Causal consistency
  • Write comprehensive tests

Acceptance Criteria

  • Full transaction support for MongoDB 4.0+
  • Automatic retry on transient errors
  • Proper session handling
  • Read/write concern configuration

Files to create

  • beatrix_core/src/mongo/transaction.rs

Example Usage

db.transaction(|session| async move {
    let user = User::new("John".to_string());
    user.save_with_session(&db, &session).await?;
    
    let profile = Profile::new(user.id());
    profile.save_with_session(&db, &session).await?;
    
    Ok((user, profile))
}).await?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore ORM functionalitymongodbMongoDB database support

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions