Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ConnectionFactoryUtils.GetTransactionalSession Method

Obtain a EMS Session that is synchronized with the current transaction, if any.

[Visual Basic]
Public Shared Sub GetTransactionalSession( _
   ByVal cf As IConnectionFactory, _
   ByVal existingCon As IConnection, _
   ByVal synchedLocalTransactionAllowed As Boolean _
)
[C#]
public static ISession GetTransactionalSession(
   IConnectionFactory cf,
   IConnection existingCon,
   bool synchedLocalTransactionAllowed
);

Parameters

cf
the ConnectionFactory to obtain a Session for
existingCon
the existing EMS Connection to obtain a Session for (may be
null
)
synchedLocalTransactionAllowed
whether to allow for a local EMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a ADO.NET-based one for a specific DataSource, for example), with the EMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.

Return Value

the transactional Session, or

null
if none found

See Also

ConnectionFactoryUtils Class | Spring.Messaging.Ems.Connections Namespace