diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFramework.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLFramework.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs index f37e9bc..ccd1ab0 100644 --- a/OpenSim/Data/MySQL/MySQLFramework.cs +++ b/OpenSim/Data/MySQL/MySQLFramework.cs | |||
@@ -40,7 +40,9 @@ 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 | ||
@@ -81,7 +83,8 @@ namespace OpenSim.Data.MySQL | |||
81 | errorSeen = true; | 83 | errorSeen = true; |
82 | 84 | ||
83 | m_Connection.Close(); | 85 | m_Connection.Close(); |
84 | MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone(); | 86 | MySqlConnection newConnection = |
87 | (MySqlConnection)((ICloneable)m_Connection).Clone(); | ||
85 | m_Connection.Dispose(); | 88 | m_Connection.Dispose(); |
86 | m_Connection = newConnection; | 89 | m_Connection = newConnection; |
87 | m_Connection.Open(); | 90 | m_Connection.Open(); |
@@ -102,15 +105,18 @@ namespace OpenSim.Data.MySQL | |||
102 | 105 | ||
103 | protected IDataReader ExecuteReader(MySqlCommand cmd) | 106 | protected IDataReader ExecuteReader(MySqlCommand cmd) |
104 | { | 107 | { |
105 | MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone(); | 108 | MySqlConnection newConnection = |
109 | (MySqlConnection)((ICloneable)m_Connection).Clone(); | ||
106 | newConnection.Open(); | 110 | newConnection.Open(); |
107 | 111 | ||
108 | cmd.Connection = newConnection; | 112 | cmd.Connection = newConnection; |
109 | return cmd.ExecuteReader(); | 113 | return cmd.ExecuteReader(); |
110 | } | 114 | } |
111 | 115 | ||
112 | protected void CloseDBConnection(MySqlCommand cmd) | 116 | protected void CloseDBConnection(IDataReader reader, MySqlCommand cmd) |
113 | { | 117 | { |
118 | reader.Close(); | ||
119 | cmd.Connection.Close(); | ||
114 | cmd.Connection.Dispose(); | 120 | cmd.Connection.Dispose(); |
115 | } | 121 | } |
116 | } | 122 | } |