Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

HibernateAccessor.AllowCreate Property

Gets or sets if a new Session should be created when no transactional Session can be found for the current thread.

[Visual Basic]
Public MustOverride Property AllowCreate() As Boolean
   Public Get
   End Get
   Public Set
   End Set
End Property
[C#]
public abstract bool AllowCreate { public get; public set; }

Property Value

true if allowed to create non-transaction session; otherwise, false.

Remarks

HibernateTemplate is aware of a corresponding Session bound to the current thread, for example when using HibernateTransactionManager. If allowCreate is true, a new non-transactional Session will be created if none found, which needs to be closed at the end of the operation. If false, an InvalidOperationException will get thrown in this case.

See Also

HibernateAccessor Class | Spring.Data.NHibernate Namespace