aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLDataStore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLDataStore.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLDataStore.cs22
1 files changed, 1 insertions, 21 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
index c7d034f..569268e 100644
--- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
@@ -71,7 +71,6 @@ namespace OpenSim.Data.MSSQL
71 private DataTable m_landAccessListTable; 71 private DataTable m_landAccessListTable;
72 72
73 /// <summary>Temporary attribute while this is experimental</summary> 73 /// <summary>Temporary attribute while this is experimental</summary>
74 private bool persistPrimInventories;
75 74
76 /*********************************************************************** 75 /***********************************************************************
77 * 76 *
@@ -83,13 +82,11 @@ namespace OpenSim.Data.MSSQL
83 /// see IRegionDataStore 82 /// see IRegionDataStore
84 /// </summary> 83 /// </summary>
85 /// <param name="connectionString"></param> 84 /// <param name="connectionString"></param>
86 /// <param name="persistPrimInventories"></param> 85 public void Initialise(string connectionString)
87 public void Initialise(string connectionString, bool persistPrimInventories)
88 { 86 {
89 // Instance.Initialise("", true); 87 // Instance.Initialise("", true);
90 88
91 m_dataSet = new DataSet(); 89 m_dataSet = new DataSet();
92 this.persistPrimInventories = persistPrimInventories;
93 90
94 m_log.Info("[REGION DB]: MSSql - connecting: " + connectionString); 91 m_log.Info("[REGION DB]: MSSql - connecting: " + connectionString);
95 m_connection = new SqlConnection(connectionString); 92 m_connection = new SqlConnection(connectionString);
@@ -126,13 +123,10 @@ namespace OpenSim.Data.MSSQL
126 setupShapeCommands(m_shapeDataAdapter, m_connection); 123 setupShapeCommands(m_shapeDataAdapter, m_connection);
127 m_shapeDataAdapter.Fill(m_shapeTable); 124 m_shapeDataAdapter.Fill(m_shapeTable);
128 125
129 if (persistPrimInventories)
130 {
131 m_itemsTable = createItemsTable(); 126 m_itemsTable = createItemsTable();
132 m_dataSet.Tables.Add(m_itemsTable); 127 m_dataSet.Tables.Add(m_itemsTable);
133 SetupItemsCommands(m_itemsDataAdapter, m_connection); 128 SetupItemsCommands(m_itemsDataAdapter, m_connection);
134 m_itemsDataAdapter.Fill(m_itemsTable); 129 m_itemsDataAdapter.Fill(m_itemsTable);
135 }
136 130
137 m_terrainTable = createTerrainTable(); 131 m_terrainTable = createTerrainTable();
138 m_dataSet.Tables.Add(m_terrainTable); 132 m_dataSet.Tables.Add(m_terrainTable);
@@ -218,10 +212,7 @@ namespace OpenSim.Data.MSSQL
218 shapeRow.Delete(); 212 shapeRow.Delete();
219 } 213 }
220 214
221 if (persistPrimInventories)
222 {
223 RemoveItems(new LLUUID((string)row["UUID"])); 215 RemoveItems(new LLUUID((string)row["UUID"]));
224 }
225 216
226 // Remove prim row 217 // Remove prim row
227 row.Delete(); 218 row.Delete();
@@ -317,11 +308,8 @@ namespace OpenSim.Data.MSSQL
317 createdObjects[new LLUUID(objID)].AddPart(prim); 308 createdObjects[new LLUUID(objID)].AddPart(prim);
318 } 309 }
319 310
320 if (persistPrimInventories)
321 {
322 LoadItems(prim); 311 LoadItems(prim);
323 } 312 }
324 }
325 catch (Exception e) 313 catch (Exception e)
326 { 314 {
327 m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows"); 315 m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
@@ -589,10 +577,7 @@ namespace OpenSim.Data.MSSQL
589 m_primDataAdapter.Update(m_primTable); 577 m_primDataAdapter.Update(m_primTable);
590 m_shapeDataAdapter.Update(m_shapeTable); 578 m_shapeDataAdapter.Update(m_shapeTable);
591 579
592 if (persistPrimInventories)
593 {
594 m_itemsDataAdapter.Update(m_itemsTable); 580 m_itemsDataAdapter.Update(m_itemsTable);
595 }
596 581
597 m_terrainDataAdapter.Update(m_terrainTable); 582 m_terrainDataAdapter.Update(m_terrainTable);
598 m_landDataAdapter.Update(m_landTable); 583 m_landDataAdapter.Update(m_landTable);
@@ -1378,9 +1363,6 @@ namespace OpenSim.Data.MSSQL
1378 /// <param name="items"></param> 1363 /// <param name="items"></param>
1379 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) 1364 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
1380 { 1365 {
1381 if (!persistPrimInventories)
1382 return;
1383
1384 m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); 1366 m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
1385 1367
1386 // For now, we're just going to crudely remove all the previous inventory items 1368 // For now, we're just going to crudely remove all the previous inventory items
@@ -1749,7 +1731,6 @@ namespace OpenSim.Data.MSSQL
1749 pDa.Fill(tmpDS, "prims"); 1731 pDa.Fill(tmpDS, "prims");
1750 sDa.Fill(tmpDS, "primshapes"); 1732 sDa.Fill(tmpDS, "primshapes");
1751 1733
1752 if (persistPrimInventories)
1753 iDa.Fill(tmpDS, "primitems"); 1734 iDa.Fill(tmpDS, "primitems");
1754 1735
1755 tDa.Fill(tmpDS, "terrain"); 1736 tDa.Fill(tmpDS, "terrain");
@@ -1765,7 +1746,6 @@ namespace OpenSim.Data.MSSQL
1765 pDa.Fill(tmpDS, "prims"); 1746 pDa.Fill(tmpDS, "prims");
1766 sDa.Fill(tmpDS, "primshapes"); 1747 sDa.Fill(tmpDS, "primshapes");
1767 1748
1768 if (persistPrimInventories)
1769 iDa.Fill(tmpDS, "primitems"); 1749 iDa.Fill(tmpDS, "primitems");
1770 1750
1771 tDa.Fill(tmpDS, "terrain"); 1751 tDa.Fill(tmpDS, "terrain");