-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathHanaDriverBase.cs
55 lines (47 loc) · 1.98 KB
/
HanaDriverBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using NHibernate.AdoNet;
namespace NHibernate.Driver
{
/// <summary>
/// Provides a database driver base class for SAP HANA.
/// </summary>
public abstract class HanaDriverBase : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider
{
/// <summary>
/// Initializes a new instance of the <see cref="HanaDriverBase"/> class.
/// </summary>
/// <exception cref="HibernateException">
/// Thrown when the <c>Sap.Data.Hana.v4.5</c> assembly can not be loaded.
/// </exception>
protected HanaDriverBase() : base(
"Sap.Data.Hana",
"Sap.Data.Hana.v4.5",
"Sap.Data.Hana.HanaConnection",
"Sap.Data.Hana.HanaCommand")
{
}
/// <inheritdoc />
/// <remarks>
/// Named parameters are not supported by the SAP HANA .Net provider.
/// https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.02/en-US/d197835a6d611014a07fd73ee6fed6eb.html
/// </remarks>
public override bool UseNamedPrefixInSql => false;
/// <inheritdoc />
public override bool UseNamedPrefixInParameter => false;
/// <inheritdoc />
public override string NamedPrefix => string.Empty;
public override IResultSetsCommand GetResultSetsCommand(Engine.ISessionImplementor session)
{
return new BasicResultSetsCommand(session);
}
/// <summary>
/// It does support it indeed, provided any previous transaction has finished completing. But scopes
/// are always promoted to distributed with <c>HanaConnection</c>, which causes them to complete on concurrent
/// threads. This creates race conditions with following a scope disposal. As this null enlistment feature
/// is here for attemptinng de-enlisting a connection from a completed transaction not yet cleaned-up, and as
/// <c>HanaConnection</c> does not handle such a case, better disable it.
/// </summary>
public override bool SupportsNullEnlistment => false;
public override bool RequiresTimeSpanForTime => true;
System.Type IEmbeddedBatcherFactoryProvider.BatcherFactoryClass => typeof(HanaBatchingBatcherFactory);
}
}