diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFramework.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLFramework.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs index c756c9c..ccd1ab0 100644 --- a/OpenSim/Data/MySQL/MySQLFramework.cs +++ b/OpenSim/Data/MySQL/MySQLFramework.cs | |||
@@ -40,14 +40,15 @@ namespace OpenSim.Data.MySQL | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public class MySqlFramework | 41 | public class MySqlFramework |
42 | { | 42 | { |
43 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly log4net.ILog m_log = |
44 | log4net.LogManager.GetLogger( | ||
45 | System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | 46 | ||
45 | protected MySqlConnection m_Connection; | 47 | protected MySqlConnection m_Connection; |
46 | 48 | ||
47 | protected MySqlFramework(string connectionString) | 49 | protected MySqlFramework(string connectionString) |
48 | { | 50 | { |
49 | m_Connection = new MySqlConnection(connectionString); | 51 | m_Connection = new MySqlConnection(connectionString); |
50 | |||
51 | m_Connection.Open(); | 52 | m_Connection.Open(); |
52 | } | 53 | } |
53 | 54 | ||
@@ -82,8 +83,8 @@ namespace OpenSim.Data.MySQL | |||
82 | errorSeen = true; | 83 | errorSeen = true; |
83 | 84 | ||
84 | m_Connection.Close(); | 85 | m_Connection.Close(); |
85 | MySqlConnection newConnection = (MySqlConnection) | 86 | MySqlConnection newConnection = |
86 | ((ICloneable)m_Connection).Clone(); | 87 | (MySqlConnection)((ICloneable)m_Connection).Clone(); |
87 | m_Connection.Dispose(); | 88 | m_Connection.Dispose(); |
88 | m_Connection = newConnection; | 89 | m_Connection = newConnection; |
89 | m_Connection.Open(); | 90 | m_Connection.Open(); |
@@ -104,14 +105,19 @@ namespace OpenSim.Data.MySQL | |||
104 | 105 | ||
105 | protected IDataReader ExecuteReader(MySqlCommand cmd) | 106 | protected IDataReader ExecuteReader(MySqlCommand cmd) |
106 | { | 107 | { |
107 | MySqlConnection newConnection = (MySqlConnection) | 108 | MySqlConnection newConnection = |
108 | ((ICloneable)m_Connection).Clone(); | 109 | (MySqlConnection)((ICloneable)m_Connection).Clone(); |
109 | |||
110 | newConnection.Open(); | 110 | newConnection.Open(); |
111 | 111 | ||
112 | cmd.Connection = newConnection; | 112 | cmd.Connection = newConnection; |
113 | |||
114 | return cmd.ExecuteReader(); | 113 | return cmd.ExecuteReader(); |
115 | } | 114 | } |
115 | |||
116 | protected void CloseDBConnection(IDataReader reader, MySqlCommand cmd) | ||
117 | { | ||
118 | reader.Close(); | ||
119 | cmd.Connection.Close(); | ||
120 | cmd.Connection.Dispose(); | ||
121 | } | ||
116 | } | 122 | } |
117 | } | 123 | } |