How to use TransactionScope

37 views
Skip to first unread message

satish viswanath

unread,
Nov 10, 2019, 6:33:24 PM11/10/19
to nhusers

I'm trying to use TransactionScope With Nhibernate. Is there any example with configuration settings to get it working.

Framework: .Net core 3.0


Sample code


Fluently.Configure()
.Database(
OracleManagedDataClientConfiguration.Oracle10.ConnectionString(connectionString))
.Mappings(cfg =>
{
cfg.FluentMappings.AddFromAssemblyOf();
}).BuildConfiguration();

using(var tx = new TransactionScope(TransactionScopeOption.Required))
{
// update model
_session.Flush();
tx.Complete();
}


I'm getting no errors but the record doesn't get committed.  Can someone share a sample code or a unit test within the solution which shows the implementation details?


I'm pretty new to NHibernate and any help is highly appreciated !!



Reply all
Reply to author
Forward
0 new messages