Skip to content

Commit bec5db8

Browse files
committed
- Minors: preparing for Transaction and AdoNet context.
- Minors in tests. SVN: trunk@3462
1 parent e7046fe commit bec5db8

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

src/NHibernate.Test/NHSpecificTest/NH1054/DummyTransactionFactory.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
2+
using NHibernate.AdoNet;
3+
using NHibernate.Transaction;
44

55
namespace NHibernate.Test.NHSpecificTest.NH1054
66
{
@@ -15,5 +15,16 @@ ITransaction NHibernate.Transaction.ITransactionFactory.CreateTransaction(NHiber
1515
{
1616
return null;
1717
}
18+
19+
public ConnectionReleaseMode DefaultReleaseMode
20+
{
21+
get { throw new NotImplementedException(); }
22+
}
23+
24+
public bool IsTransactionInProgress(AdoNetContext adoNetContext, ITransactionContext transactionContext,
25+
ITransaction transaction)
26+
{
27+
throw new NotImplementedException();
28+
}
1829
}
1930
}

src/NHibernate/ConnectionReleaseMode.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System;
2-
31
namespace NHibernate
42
{
53
public enum ConnectionReleaseMode
64
{
5+
AfterStatement,
76
AfterTransaction,
87
OnClose
98

src/NHibernate/Transaction/AdoNetTransactionFactory.cs

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections;
2+
using NHibernate.AdoNet;
23
using NHibernate.Engine;
34

45
namespace NHibernate.Transaction
@@ -13,5 +14,16 @@ public ITransaction CreateTransaction(ISessionImplementor session)
1314
public void Configure(IDictionary props)
1415
{
1516
}
17+
18+
public ConnectionReleaseMode DefaultReleaseMode
19+
{
20+
get { throw new System.NotImplementedException(); }
21+
}
22+
23+
public bool IsTransactionInProgress(AdoNetContext adoNetContext, ITransactionContext transactionContext,
24+
ITransaction transaction)
25+
{
26+
throw new System.NotImplementedException();
27+
}
1628
}
1729
}

src/NHibernate/Transaction/ITransactionFactory.cs

+22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections;
22
using NHibernate;
3+
using NHibernate.AdoNet;
34
using NHibernate.Engine;
45

56
namespace NHibernate.Transaction
@@ -24,5 +25,26 @@ public interface ITransactionFactory
2425
/// Create a new transaction and return it without starting it.
2526
/// </summary>
2627
ITransaction CreateTransaction(ISessionImplementor session);
28+
29+
/// <summary>
30+
/// Get the default connection release mode
31+
/// </summary>
32+
ConnectionReleaseMode DefaultReleaseMode { get; }
33+
34+
//TODO: do we need this?
35+
//bool IsTransactionManagerRequired { get; }
36+
37+
//TODO: do we need this?
38+
//bool AreCallbacksLocalToHibernateTransactions { get; }
39+
40+
/// <summary>
41+
/// Determine whether an underlying transaction is in progress.
42+
///
43+
/// Mainly this is used in determining whether to register a
44+
/// synchronization as well as whether or not to circumvent
45+
/// auto flushing outside transactions.
46+
/// </summary>
47+
/// <returns>true if an underlying transaction is know to be in effect.</returns>
48+
bool IsTransactionInProgress(AdoNetContext adoNetContext, ITransactionContext transactionContext, ITransaction transaction);
2749
}
2850
}

0 commit comments

Comments
 (0)