@Deprecated public class TransactionAwareConnectionFactoryProxy extends DelegatingConnectionFactory
ConnectionFactory, adding awareness of Spring-managed transactions.
Data access code that should remain unaware of Spring's data access support can work with this proxy to seamlessly
participate in Spring-managed transactions. Note that the transaction manager, for example
R2dbcTransactionManager, still needs to work with the underlying
ConnectionFactory, not with
Make sure that
TransactionAwareConnectionFactoryProxy is the outermost
ConnectionFactory of a
TransactionAwareConnectionFactoryProxy can delegate
either directly to the target connection pool or to some intermediary proxy/adapter.
ConnectionFactoryUtils for automatically participating in thread-bound transactions, for example
create() calls and
close calls on returned
Connection will behave properly within a transaction, i.e. always operate on the transactional Connection. If
not within a transaction, normal
ConnectionFactory behavior applies.
This proxy allows data access code to work with the plain R2DBC API. However, if possible, use Spring's
DatabaseClient to get transaction participation even without a proxy for
ConnectionFactory, avoiding the need to define such a proxy in the first place.
ConnectionFactory proxy needs to return wrapped
Connections (which implement the
ConnectionProxy interface) in order to handle close calls properly. Use
Wrapped.unwrap() to retrieve
the native R2DBC Connection.
|Constructor and Description|
Create a new
|Modifier and Type||Method and Description|
getMetadata, getTargetConnectionFactory, obtainTargetConnectionFactory, unwrap
public TransactionAwareConnectionFactoryProxy(ConnectionFactory targetConnectionFactory)
public reactor.core.publisher.Mono<Connection> create()
ConnectionFactoryUtilsfor automatically participating in Spring-managed transactions.
protected reactor.core.publisher.Mono<Connection> getTransactionAwareConnectionProxy(ConnectionFactory targetConnectionFactory)
Connectionwith a proxy that delegates every method call to it but delegates
Copyright © 2018–2021 Pivotal Software, Inc.. All rights reserved.