Packages

trait Transactions extends AnyRef

Effectively provides the behaviour not available on org.mongodb.scala.ClientSession (driver-scala, nor com.mongodb.reactivestreams.client.ClientSession driver-reactive-streams) but is available on com.mongodb.client.ClientSession (driver-core).

It is recommended to use the Future variant (i.e. add .toFuture to all db calls), since the Observable variant has some surprises. E.g.

  • some commands return Observable[Void] which will ignore any following map/flatMap (e.g. for-comprehension steps)
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Transactions
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def mongoComponent: MongoComponent
    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. def completeWith[A](obs: Observable[Void], f: => A): Observable[A]

    Observable[Void] by definition will never emit a value to be mapped (see org.mongodb.scala.internal.MapObservable).

    Observable[Void] by definition will never emit a value to be mapped (see org.mongodb.scala.internal.MapObservable). When converting to Future, it works since it completes with None (see org.mongodb.scala.Observable.headOption). This function converts an Observable[Void] to the provided value to continue.

    completeWithUnit now exists on Observable but throws "java.lang.IllegalStateException: The Observable has not been subscribed to."

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. def withClientSession[A](f: (ClientSession) => Observable[A])(implicit tc: TransactionConfiguration): Observable[A]
  21. def withClientSession[A](f: (ClientSession) => Future[A])(implicit tc: TransactionConfiguration, ec: ExecutionContext): Future[A]
  22. def withSessionAndTransaction[A](f: (ClientSession) => Observable[A])(implicit tc: TransactionConfiguration): Observable[A]
  23. def withSessionAndTransaction[A](f: (ClientSession) => Future[A])(implicit tc: TransactionConfiguration, ec: ExecutionContext): Future[A]
  24. def withTransaction[A](session: ClientSession, f: => Observable[A])(implicit tc: TransactionConfiguration): Observable[A]

    A transaction is started before running the continuation.

    A transaction is started before running the continuation. It will be committed or aborted depending on whether the callback executes successfully or not. It also provides retries for network issues See https://github.com/mongodb/mongo-java-driver/tree/r4.3.1/driver-core/src/test/resources/transactions-convenient-api#retry-timeout-is-enforced And https://docs.mongodb.com/manual/core/retryable-writes/#retryable-writes-and-multi-document-transactions

  25. def withTransaction[A](session: ClientSession, f: => Future[A])(implicit tc: TransactionConfiguration, ec: ExecutionContext): Future[A]

    A transaction is started before running the continuation.

    A transaction is started before running the continuation. It will be committed or aborted depending on whether the callback executes successfully or not. It also provides retries for network issues See https://github.com/mongodb/mongo-java-driver/tree/r4.3.1/driver-core/src/test/resources/transactions-convenient-api#retry-timeout-is-enforced And https://docs.mongodb.com/manual/core/retryable-writes/#retryable-writes-and-multi-document-transactions

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped