Skip to content

Commit d896be5

Browse files
fixup! Obsolete Transaction properties
1 parent e561ae5 commit d896be5

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/NHibernate.Test/Async/TransactionTest/TransactionFixture.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ public async Task WasCommittedOrRolledBackAsync()
9595
{
9696
using (ITransaction t = s.BeginTransaction())
9797
{
98-
Assert.AreSame(t, s.CurrentTransaction);
99-
Assert.IsFalse(s.CurrentTransaction.WasCommitted);
100-
Assert.IsFalse(s.CurrentTransaction.WasRolledBack);
98+
Assert.AreSame(t, s.GetCurrentTransaction());
99+
Assert.IsFalse(s.GetCurrentTransaction().WasCommitted);
100+
Assert.IsFalse(s.GetCurrentTransaction().WasRolledBack);
101101
await (t.CommitAsync());
102102

103-
// ISession.CurrentTransaction does not return a new transaction
103+
// ISession.GetCurrentTransaction() does not return a new transaction
104104
// if the previous one is completed.
105-
Assert.IsNull(s.CurrentTransaction);
105+
Assert.IsNull(s.GetCurrentTransaction());
106106

107107
Assert.IsTrue(t.WasCommitted);
108108
Assert.IsFalse(t.WasRolledBack);
@@ -113,9 +113,9 @@ public async Task WasCommittedOrRolledBackAsync()
113113
{
114114
await (t.RollbackAsync());
115115

116-
// ISession.CurrentTransaction does not return a new transaction
116+
// ISession.GetCurrentTransaction() does not return a new transaction
117117
// if the previous one is completed.
118-
Assert.IsNull(s.CurrentTransaction);
118+
Assert.IsNull(s.GetCurrentTransaction());
119119

120120
Assert.IsTrue(t.WasRolledBack);
121121
Assert.IsFalse(t.WasCommitted);

src/NHibernate.Test/ConnectionTest/ThreadLocalCurrentSessionTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override void Configure(Configuration configuration)
2525
protected override void Release(ISession session)
2626
{
2727
long initialCount = Sfi.Statistics.SessionCloseCount;
28-
session.CurrentTransaction?.Commit();
28+
session.GetCurrentTransaction()?.Commit();
2929
long subsequentCount = Sfi.Statistics.SessionCloseCount;
3030
Assert.AreEqual(initialCount + 1, subsequentCount, "Session still open after commit");
3131
// also make sure it was cleaned up from the internal ThreadLocal...

src/NHibernate.Test/NHSpecificTest/NH2583/AbstractMassTestingFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ private static IEnumerable<int> CreateObjects<T1, T2, T3, T4, T5, T6, T7>(ISessi
234234
}
235235
if ((i%BatchSize) == 0)
236236
{
237-
if (session.CurrentTransaction?.IsActive == true)
237+
if (session.GetCurrentTransaction()?.IsActive == true)
238238
{
239-
session.CurrentTransaction.Commit();
239+
session.GetCurrentTransaction().Commit();
240240
session.Clear();
241241
}
242242
session.BeginTransaction();
@@ -250,9 +250,9 @@ private static IEnumerable<int> CreateObjects<T1, T2, T3, T4, T5, T6, T7>(ISessi
250250
// emulating the outer-join logic for exceptional cases in Lin2Objects is IMO very hard.
251251
}
252252
}
253-
if (session.CurrentTransaction?.IsActive == true)
253+
if (session.GetCurrentTransaction()?.IsActive == true)
254254
{
255-
session.CurrentTransaction.Commit();
255+
session.GetCurrentTransaction().Commit();
256256
session.Clear();
257257
}
258258

src/NHibernate.Test/TransactionTest/TransactionFixture.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public void WasCommittedOrRolledBack()
9797
{
9898
using (ITransaction t = s.BeginTransaction())
9999
{
100-
Assert.AreSame(t, s.CurrentTransaction);
101-
Assert.IsFalse(s.CurrentTransaction.WasCommitted);
102-
Assert.IsFalse(s.CurrentTransaction.WasRolledBack);
100+
Assert.AreSame(t, s.GetCurrentTransaction());
101+
Assert.IsFalse(s.GetCurrentTransaction().WasCommitted);
102+
Assert.IsFalse(s.GetCurrentTransaction().WasRolledBack);
103103
t.Commit();
104104

105-
// ISession.CurrentTransaction does not return a new transaction
105+
// ISession.GetCurrentTransaction() does not return a new transaction
106106
// if the previous one is completed.
107-
Assert.IsNull(s.CurrentTransaction);
107+
Assert.IsNull(s.GetCurrentTransaction());
108108

109109
Assert.IsTrue(t.WasCommitted);
110110
Assert.IsFalse(t.WasRolledBack);
@@ -115,9 +115,9 @@ public void WasCommittedOrRolledBack()
115115
{
116116
t.Rollback();
117117

118-
// ISession.CurrentTransaction does not return a new transaction
118+
// ISession.GetCurrentTransaction() does not return a new transaction
119119
// if the previous one is completed.
120-
Assert.IsNull(s.CurrentTransaction);
120+
Assert.IsNull(s.GetCurrentTransaction());
121121

122122
Assert.IsTrue(t.WasRolledBack);
123123
Assert.IsFalse(t.WasCommitted);

0 commit comments

Comments
 (0)