Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

TransactionSynchronizationManager.CurrentTransactionReadOnly Property

Gets or sets a value indicating whether the current transaction is read only.

[Visual Basic]
Public Shared Property CurrentTransactionReadOnly() As Boolean
   Public Get
   End Get
   Public Set
   End Set
End Property
[C#]
public static bool CurrentTransactionReadOnly { public get; public set; }

Property Value

true if current transaction read only; otherwise, false.

Remarks

Called by transaction manager on transaction begin and on cleanup. Return whether the current transaction is marked as read-only. To be called by resource management code when preparing a newly created resource (for example, a Hibernate Session).

Note that transaction synchronizations receive the read-only flag as argument for the

beforeCommit
callback, to be able to suppress change detection on commit. The present method is meant to be used for earlier read-only checks, for example to set the flush mode of a Hibernate Session to FlushMode.Never upfront.

See Also

TransactionSynchronizationManager Class | Spring.Transaction.Support Namespace