Skip to content

Commit fc258e4

Browse files
committed
Small provider improvements
1 parent 38da18a commit fc258e4

2 files changed

Lines changed: 26 additions & 41 deletions

File tree

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/Connection.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ namespace Xtensive.Sql.Drivers.Firebird
1313
{
1414
internal class Connection : SqlConnection
1515
{
16-
private FbConnection underlyingConnection;
17-
private FbTransaction activeTransaction;
16+
protected FbConnection underlyingConnection;
17+
protected FbTransaction activeTransaction;
1818

1919
/// <inheritdoc/>
2020
public override DbConnection UnderlyingConnection => underlyingConnection;
@@ -36,26 +36,26 @@ public override void BeginTransaction(IsolationLevel isolationLevel)
3636

3737
var transactionOptions = CreateTransactionOptions(isolationLevel);
3838
activeTransaction = underlyingConnection.BeginTransaction(transactionOptions);
39-
}
4039

41-
private static FbTransactionOptions CreateTransactionOptions(IsolationLevel isolationLevel)
42-
{
43-
var transactionOptions = new FbTransactionOptions {WaitTimeout = TimeSpan.FromSeconds(10)};
44-
switch (SqlHelper.ReduceIsolationLevel(isolationLevel)) {
45-
case IsolationLevel.ReadCommitted:
46-
transactionOptions.TransactionBehavior = FbTransactionBehavior.ReadCommitted
47-
| FbTransactionBehavior.NoRecVersion
48-
| FbTransactionBehavior.Write
49-
| FbTransactionBehavior.NoWait;
50-
break;
51-
case IsolationLevel.Serializable:
52-
transactionOptions.TransactionBehavior = FbTransactionBehavior.Concurrency
53-
| FbTransactionBehavior.Write
54-
| FbTransactionBehavior.Wait;
55-
break;
56-
}
40+
static FbTransactionOptions CreateTransactionOptions(IsolationLevel isolationLevel)
41+
{
42+
var transactionOptions = new FbTransactionOptions { WaitTimeout = TimeSpan.FromSeconds(10) };
43+
switch (SqlHelper.ReduceIsolationLevel(isolationLevel)) {
44+
case IsolationLevel.ReadCommitted:
45+
transactionOptions.TransactionBehavior = FbTransactionBehavior.ReadCommitted
46+
| FbTransactionBehavior.NoRecVersion
47+
| FbTransactionBehavior.Write
48+
| FbTransactionBehavior.NoWait;
49+
break;
50+
case IsolationLevel.Serializable:
51+
transactionOptions.TransactionBehavior = FbTransactionBehavior.Concurrency
52+
| FbTransactionBehavior.Write
53+
| FbTransactionBehavior.Wait;
54+
break;
55+
}
5756

58-
return transactionOptions;
57+
return transactionOptions;
58+
}
5959
}
6060

6161
/// <inheritdoc/>
@@ -85,4 +85,4 @@ public Connection(SqlDriver driver)
8585
underlyingConnection = new FbConnection();
8686
}
8787
}
88-
} ;
88+
}

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/v4_0/Driver.cs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,15 @@ namespace Xtensive.Sql.Drivers.Firebird.v4_0
1212
{
1313
internal class Driver : v2_5.Driver
1414
{
15-
protected override Sql.TypeMapper CreateTypeMapper()
16-
{
17-
return new TypeMapper(this);
18-
}
15+
protected override Sql.TypeMapper CreateTypeMapper() => new TypeMapper(this);
1916

20-
protected override SqlCompiler CreateCompiler()
21-
{
22-
return new Compiler(this);
23-
}
17+
protected override SqlCompiler CreateCompiler() => new Compiler(this);
2418

25-
protected override SqlTranslator CreateTranslator()
26-
{
27-
return new Translator(this);
28-
}
19+
protected override SqlTranslator CreateTranslator() => new Translator(this);
2920

30-
protected override Model.Extractor CreateExtractor()
31-
{
32-
return new Extractor(this);
33-
}
21+
protected override Model.Extractor CreateExtractor() => new Extractor(this);
3422

35-
protected override Info.ServerInfoProvider CreateServerInfoProvider()
36-
{
37-
return new ServerInfoProvider(this);
38-
}
23+
protected override Info.ServerInfoProvider CreateServerInfoProvider() => new ServerInfoProvider(this);
3924

4025
// Constructors
4126

0 commit comments

Comments
 (0)