open class CciLocalTransactionManager : AbstractPlatformTransactionManager, ResourceTransactionManager, InitializingBean
org.springframework.transaction.PlatformTransactionManager implementation that manages local transactions for a single CCI ConnectionFactory. Binds a CCI Connection from the specified ConnectionFactory to the thread, potentially allowing for one thread-bound Connection per ConnectionFactory.
Application code is required to retrieve the CCI Connection via ConnectionFactoryUtils#getConnection(ConnectionFactory)
instead of a standard Java EE-style ConnectionFactory#getConnection()
call. Spring classes such as org.springframework.jca.cci.core.CciTemplate use this strategy implicitly. If not used in combination with this transaction manager, the ConnectionFactoryUtils lookup strategy behaves exactly like the native DataSource lookup; it can thus be used in a portable fashion.
Alternatively, you can allow application code to work with the standard Java EE lookup pattern ConnectionFactory#getConnection()
, for example for legacy code that is not aware of Spring at all. In that case, define a TransactionAwareConnectionFactoryProxy for your target ConnectionFactory, which will automatically participate in Spring-managed transactions.
Author
Thierry Templier
Author
Juergen Hoeller
Since
1.2
See Also
ConnectionFactoryUtils#getConnection(javax.resource.cci.ConnectionFactory)ConnectionFactoryUtils#releaseConnectionTransactionAwareConnectionFactoryProxyorg.springframework.jca.cci.core.CciTemplate
CciLocalTransactionManager()
Create a new CciLocalTransactionManager instance. A ConnectionFactory has to be set to be able to use it. CciLocalTransactionManager(connectionFactory: ConnectionFactory)
Create a new CciLocalTransactionManager instance. |
open fun afterPropertiesSet(): Unit |
|
open fun getConnectionFactory(): ConnectionFactory
Return the CCI ConnectionFactory that this instance manages local transactions for. |
|
open fun getResourceFactory(): Any |
|
open fun setConnectionFactory(cf: ConnectionFactory): Unit
Set the CCI ConnectionFactory that this instance should manage local transactions for. |