aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLFramework.cs
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-03 21:44:39 +1000
committerDavid Walter Seikel2016-11-03 21:44:39 +1000
commit134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch)
tree216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Data/MySQL/MySQLFramework.cs
parentMore changing to production grid. Double oops. (diff)
downloadopensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip
opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz
opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2
opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFramework.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLFramework.cs33
1 files changed, 12 insertions, 21 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs
index 3fdcf1e..5820a90 100644
--- a/OpenSim/Data/MySQL/MySQLFramework.cs
+++ b/OpenSim/Data/MySQL/MySQLFramework.cs
@@ -45,38 +45,29 @@ namespace OpenSim.Data.MySQL
45 System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 45 System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected string m_connectionString; 47 protected string m_connectionString;
48 protected object m_dbLock = new object();
49 48
50 protected MySqlFramework(string connectionString) 49 protected MySqlFramework(string connectionString)
51 { 50 {
52 m_connectionString = connectionString; 51 m_connectionString = connectionString;
53 } 52 }
54 53
55 //////////////////////////////////////////////////////////////
56 //
57 // All non queries are funneled through one connection
58 // to increase performance a little
59 //
60 protected int ExecuteNonQuery(MySqlCommand cmd) 54 protected int ExecuteNonQuery(MySqlCommand cmd)
61 { 55 {
62 lock (m_dbLock) 56 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
63 { 57 {
64 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 58 dbcon.Open();
65 { 59 cmd.Connection = dbcon;
66 dbcon.Open();
67 cmd.Connection = dbcon;
68 60
69 try 61 try
70 { 62 {
71 return cmd.ExecuteNonQuery(); 63 return cmd.ExecuteNonQuery();
72 } 64 }
73 catch (Exception e) 65 catch (Exception e)
74 { 66 {
75 m_log.Error(e.Message, e); 67 m_log.Error(e.Message, e);
76 return 0; 68 return 0;
77 }
78 } 69 }
79 } 70 }
80 } 71 }
81 } 72 }
82} 73} \ No newline at end of file