Class ConnectionHolder

java.lang.Object
org.springframework.transaction.support.ResourceHolderSupport
org.springframework.r2dbc.connection.ConnectionHolder
All Implemented Interfaces:
ResourceHolder

public class ConnectionHolder extends ResourceHolderSupport
Resource holder wrapping a R2DBC Connection. R2dbcTransactionManager binds instances of this class to the subscription, for a specific ConnectionFactory.

Inherits rollback-only support for nested R2DBC transactions and reference count functionality from the base class.

Note: This is an SPI class, not intended to be used by applications.

Since:
5.3
Author:
Mark Paluch, Christoph Strobl
See Also:
  • Constructor Details

    • ConnectionHolder

      public ConnectionHolder(Connection connection)
      Create a new ConnectionHolder for the given R2DBC Connection, assuming that there is no ongoing transaction.
      Parameters:
      connection - the R2DBC Connection to hold
      See Also:
    • ConnectionHolder

      public ConnectionHolder(Connection connection, boolean transactionActive)
      Create a new ConnectionHolder for the given R2DBC Connection.
      Parameters:
      connection - the R2DBC Connection to hold
      transactionActive - whether the given Connection is involved in an ongoing transaction
  • Method Details