aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-30 16:00:31 +0100
committerJustin Clark-Casey (justincc)2012-04-30 16:00:31 +0100
commit4ad45934c67f221fa54e1c7407949b375956eed6 (patch)
treea192e3cbc02e1bdcfd353ebf9a88bd93406fe706 /OpenSim/Data/MySQL
parentConsistently use using() to make sure we dispose of used MySqlCommands where ... (diff)
downloadopensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.zip
opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.gz
opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.bz2
opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.xz
If there are no new prim items to store then don't bother opening the MySqlConnection only to do nothing with it.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index b36ff5a..b2a1481 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -1800,15 +1800,15 @@ namespace OpenSim.Data.MySQL
1800 { 1800 {
1801 RemoveItems(primID); 1801 RemoveItems(primID);
1802 1802
1803 if (items.Count == 0)
1804 return;
1805
1803 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 1806 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1804 { 1807 {
1805 dbcon.Open(); 1808 dbcon.Open();
1806 1809
1807 using (MySqlCommand cmd = dbcon.CreateCommand()) 1810 using (MySqlCommand cmd = dbcon.CreateCommand())
1808 { 1811 {
1809 if (items.Count == 0)
1810 return;
1811
1812 cmd.CommandText = "insert into primitems (" + 1812 cmd.CommandText = "insert into primitems (" +
1813 "invType, assetType, name, " + 1813 "invType, assetType, name, " +
1814 "description, creationDate, nextPermissions, " + 1814 "description, creationDate, nextPermissions, " +