forked from ServiceStack/ServiceStack.OrmLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOracleConnection.cs
More file actions
79 lines (66 loc) · 1.94 KB
/
Copy pathOracleConnection.cs
File metadata and controls
79 lines (66 loc) · 1.94 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Data;
using System.Data.Common;
namespace ServiceStack.OrmLite.Oracle
{
public class OracleConnection : DbConnection
{
private readonly DbConnection _connection;
public OracleConnection(DbConnection connection)
{
if (connection == null)
throw new ArgumentNullException("connection");
_connection = connection;
}
protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
{
return _connection.BeginTransaction(isolationLevel);
}
public override void Close()
{
_connection.Close();
}
public override void ChangeDatabase(string databaseName)
{
_connection.ChangeDatabase(databaseName);
}
public override void Open()
{
if (_connection.State != ConnectionState.Open)
_connection.Open();
}
public override string ConnectionString
{
get { return _connection.ConnectionString; }
set { _connection.ConnectionString = value; }
}
public override string Database
{
get { return _connection.Database; }
}
public override string DataSource
{
get { return _connection.DataSource; }
}
public override ConnectionState State
{
get { return _connection.State; }
}
public override string ServerVersion
{
get { return _connection.ServerVersion; }
}
protected override DbCommand CreateDbCommand()
{
return new OracleCommand(_connection.CreateCommand());
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
_connection.Dispose();
}
base.Dispose(disposing);
}
}
}