aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-18 20:50:47 +0000
committerMelanie Thielker2008-07-18 20:50:47 +0000
commita73d87ef1651ac1e935e0cfebed99282a69c3941 (patch)
tree5d3428e079e5f720670215b7071da0f331648709 /OpenSim/Data
parentPatch to fix saving of estate managers list loaded during migration. (diff)
downloadopensim-SC-a73d87ef1651ac1e935e0cfebed99282a69c3941.zip
opensim-SC-a73d87ef1651ac1e935e0cfebed99282a69c3941.tar.gz
opensim-SC-a73d87ef1651ac1e935e0cfebed99282a69c3941.tar.bz2
opensim-SC-a73d87ef1651ac1e935e0cfebed99282a69c3941.tar.xz
Introduce a separate connection string for estates, which defaults to the one gi
ven for the region datastore. Removes the flag to store prim inventories, which are now always stored.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLDataStore.cs22
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs23
-rw-r--r--OpenSim/Data/NHibernate/NHibernateRegionData.cs2
-rw-r--r--OpenSim/Data/Null/NullDataStore.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs25
5 files changed, 5 insertions, 69 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");
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index d1db064..74f15cb 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -92,9 +92,6 @@ namespace OpenSim.Data.MySQL
92 private DataTable m_landAccessListTable; 92 private DataTable m_landAccessListTable;
93 private DataTable m_regionSettingsTable; 93 private DataTable m_regionSettingsTable;
94 94
95 /// <value>Temporary attribute while this is experimental</value>
96 private bool persistPrimInventories;
97
98 /*********************************************************************** 95 /***********************************************************************
99 * 96 *
100 * Public Interface Functions 97 * Public Interface Functions
@@ -105,13 +102,11 @@ namespace OpenSim.Data.MySQL
105 /// see IRegionDataStore 102 /// see IRegionDataStore
106 /// </summary> 103 /// </summary>
107 /// <param name="connectionstring"></param> 104 /// <param name="connectionstring"></param>
108 /// <param name="persistPrimInventories"></param> 105 public void Initialise(string connectionString)
109 public void Initialise(string connectionString, bool persistPrimInventories)
110 { 106 {
111 m_connectionString = connectionString; 107 m_connectionString = connectionString;
112 108
113 m_dataSet = new DataSet(); 109 m_dataSet = new DataSet();
114 this.persistPrimInventories = persistPrimInventories;
115 110
116 int passPosition = 0; 111 int passPosition = 0;
117 int passEndPosition = 0; 112 int passEndPosition = 0;
@@ -184,13 +179,10 @@ namespace OpenSim.Data.MySQL
184 m_shapeDataAdapter.Fill(m_shapeTable); 179 m_shapeDataAdapter.Fill(m_shapeTable);
185 180
186 181
187 if (persistPrimInventories)
188 {
189 m_itemsTable = createItemsTable(); 182 m_itemsTable = createItemsTable();
190 m_dataSet.Tables.Add(m_itemsTable); 183 m_dataSet.Tables.Add(m_itemsTable);
191 SetupItemsCommands(m_itemsDataAdapter, m_connection); 184 SetupItemsCommands(m_itemsDataAdapter, m_connection);
192 m_itemsDataAdapter.Fill(m_itemsTable); 185 m_itemsDataAdapter.Fill(m_itemsTable);
193 }
194 186
195 m_terrainTable = createTerrainTable(); 187 m_terrainTable = createTerrainTable();
196 m_dataSet.Tables.Add(m_terrainTable); 188 m_dataSet.Tables.Add(m_terrainTable);
@@ -429,10 +421,7 @@ namespace OpenSim.Data.MySQL
429 shapeRow.Delete(); 421 shapeRow.Delete();
430 } 422 }
431 423
432 if (persistPrimInventories)
433 {
434 RemoveItems(uuid); 424 RemoveItems(uuid);
435 }
436 425
437 // Remove prim row 426 // Remove prim row
438 row.Delete(); 427 row.Delete();
@@ -527,11 +516,8 @@ namespace OpenSim.Data.MySQL
527 createdObjects[new LLUUID(objID)].AddPart(prim); 516 createdObjects[new LLUUID(objID)].AddPart(prim);
528 } 517 }
529 518
530 if (persistPrimInventories)
531 {
532 LoadItems(prim); 519 LoadItems(prim);
533 } 520 }
534 }
535 catch (Exception e) 521 catch (Exception e)
536 { 522 {
537 m_log.Error("[REGION DB]: Failed create prim object, exception and data follows"); 523 m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
@@ -827,10 +813,7 @@ namespace OpenSim.Data.MySQL
827 m_primDataAdapter.Update(m_primTable); 813 m_primDataAdapter.Update(m_primTable);
828 m_shapeDataAdapter.Update(m_shapeTable); 814 m_shapeDataAdapter.Update(m_shapeTable);
829 815
830 if (persistPrimInventories)
831 {
832 m_itemsDataAdapter.Update(m_itemsTable); 816 m_itemsDataAdapter.Update(m_itemsTable);
833 }
834 817
835 m_terrainDataAdapter.Update(m_terrainTable); 818 m_terrainDataAdapter.Update(m_terrainTable);
836 m_landDataAdapter.Update(m_landTable); 819 m_landDataAdapter.Update(m_landTable);
@@ -1812,9 +1795,6 @@ namespace OpenSim.Data.MySQL
1812 /// <param name="items"></param> 1795 /// <param name="items"></param>
1813 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) 1796 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
1814 { 1797 {
1815 if (!persistPrimInventories)
1816 return;
1817
1818 m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); 1798 m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
1819 1799
1820 // For now, we're just going to crudely remove all the previous inventory items 1800 // For now, we're just going to crudely remove all the previous inventory items
@@ -2241,7 +2221,6 @@ namespace OpenSim.Data.MySQL
2241 // pDa.Fill(tmpDS, "prims"); 2221 // pDa.Fill(tmpDS, "prims");
2242 // sDa.Fill(tmpDS, "primshapes"); 2222 // sDa.Fill(tmpDS, "primshapes");
2243 2223
2244 // if (persistPrimInventories)
2245 // iDa.Fill(tmpDS, "primitems"); 2224 // iDa.Fill(tmpDS, "primitems");
2246 2225
2247 // tDa.Fill(tmpDS, "terrain"); 2226 // tDa.Fill(tmpDS, "terrain");
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index 40861ae..55331d5 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Data.NHibernate
61 // Initialise("SQLiteDialect;SqliteClientDriver;URI=file:OpenSim.db,version=3", true); 61 // Initialise("SQLiteDialect;SqliteClientDriver;URI=file:OpenSim.db,version=3", true);
62 // } 62 // }
63 63
64 public void Initialise(string connect, bool persistpriminventories) 64 public void Initialise(string connect)
65 { 65 {
66 // Split out the dialect, driver, and connect string 66 // Split out the dialect, driver, and connect string
67 char[] split = {';'}; 67 char[] split = {';'};
diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullDataStore.cs
index e244a5e..76369bd 100644
--- a/OpenSim/Data/Null/NullDataStore.cs
+++ b/OpenSim/Data/Null/NullDataStore.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Data.Null
38 /// </summary> 38 /// </summary>
39 public class NullDataStore : IRegionDataStore 39 public class NullDataStore : IRegionDataStore
40 { 40 {
41 public void Initialise(string dbfile, bool persistPrimInventories) 41 public void Initialise(string dbfile)
42 { 42 {
43 return; 43 return;
44 } 44 }
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 4e87e0d..6e30060 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -68,7 +68,6 @@ namespace OpenSim.Data.SQLite
68 private String m_connectionString; 68 private String m_connectionString;
69 69
70 // Temporary attribute while this is experimental 70 // Temporary attribute while this is experimental
71 private bool persistPrimInventories;
72 71
73 /*********************************************************************** 72 /***********************************************************************
74 * 73 *
@@ -84,11 +83,9 @@ namespace OpenSim.Data.SQLite
84 /// </list> 83 /// </list>
85 /// </summary> 84 /// </summary>
86 /// <param name="connectionString">the connection string</param> 85 /// <param name="connectionString">the connection string</param>
87 /// <param name="persistPrimInventories">?</param> 86 public void Initialise(string connectionString)
88 public void Initialise(string connectionString, bool persistPrimInventories)
89 { 87 {
90 m_connectionString = connectionString; 88 m_connectionString = connectionString;
91 this.persistPrimInventories = persistPrimInventories;
92 89
93 ds = new DataSet(); 90 ds = new DataSet();
94 91
@@ -137,12 +134,9 @@ namespace OpenSim.Data.SQLite
137 ds.Tables.Add(createShapeTable()); 134 ds.Tables.Add(createShapeTable());
138 setupShapeCommands(shapeDa, m_conn); 135 setupShapeCommands(shapeDa, m_conn);
139 136
140 if (persistPrimInventories)
141 {
142 ds.Tables.Add(createItemsTable()); 137 ds.Tables.Add(createItemsTable());
143 setupItemsCommands(itemsDa, m_conn); 138 setupItemsCommands(itemsDa, m_conn);
144 itemsDa.Fill(ds.Tables["primitems"]); 139 itemsDa.Fill(ds.Tables["primitems"]);
145 }
146 140
147 ds.Tables.Add(createTerrainTable()); 141 ds.Tables.Add(createTerrainTable());
148 setupTerrainCommands(terrainDa, m_conn); 142 setupTerrainCommands(terrainDa, m_conn);
@@ -267,10 +261,7 @@ namespace OpenSim.Data.SQLite
267 shapeRow.Delete(); 261 shapeRow.Delete();
268 } 262 }
269 263
270 if (persistPrimInventories)
271 {
272 RemoveItems(uuid); 264 RemoveItems(uuid);
273 }
274 265
275 // Remove prim row 266 // Remove prim row
276 row.Delete(); 267 row.Delete();
@@ -367,11 +358,8 @@ namespace OpenSim.Data.SQLite
367 createdObjects[new LLUUID(objID)].AddPart(prim); 358 createdObjects[new LLUUID(objID)].AddPart(prim);
368 } 359 }
369 360
370 if (persistPrimInventories)
371 {
372 LoadItems(prim); 361 LoadItems(prim);
373 } 362 }
374 }
375 catch (Exception e) 363 catch (Exception e)
376 { 364 {
377 m_log.Error("[REGION DB]: Failed create prim object, exception and data follows"); 365 m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
@@ -615,10 +603,7 @@ namespace OpenSim.Data.SQLite
615 primDa.Update(ds, "prims"); 603 primDa.Update(ds, "prims");
616 shapeDa.Update(ds, "primshapes"); 604 shapeDa.Update(ds, "primshapes");
617 605
618 if (persistPrimInventories)
619 {
620 itemsDa.Update(ds, "primitems"); 606 itemsDa.Update(ds, "primitems");
621 }
622 607
623 terrainDa.Update(ds, "terrain"); 608 terrainDa.Update(ds, "terrain");
624 landDa.Update(ds, "land"); 609 landDa.Update(ds, "land");
@@ -1475,9 +1460,6 @@ namespace OpenSim.Data.SQLite
1475 /// <param name="items"></param> 1460 /// <param name="items"></param>
1476 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) 1461 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
1477 { 1462 {
1478 if (!persistPrimInventories)
1479 return;
1480
1481 m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID); 1463 m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
1482 1464
1483 DataTable dbItems = ds.Tables["primitems"]; 1465 DataTable dbItems = ds.Tables["primitems"];
@@ -1779,8 +1761,6 @@ namespace OpenSim.Data.SQLite
1779 // m_log.Warn("[REGION DB]: Shapes Table Already Exists"); 1761 // m_log.Warn("[REGION DB]: Shapes Table Already Exists");
1780 // } 1762 // }
1781 1763
1782 // if (persistPrimInventories)
1783 // {
1784 // try 1764 // try
1785 // { 1765 // {
1786 // icmd.ExecuteNonQuery(); 1766 // icmd.ExecuteNonQuery();
@@ -1789,7 +1769,6 @@ namespace OpenSim.Data.SQLite
1789 // { 1769 // {
1790 // m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists"); 1770 // m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists");
1791 // } 1771 // }
1792 // }
1793 1772
1794 // try 1773 // try
1795 // { 1774 // {
@@ -1851,7 +1830,6 @@ namespace OpenSim.Data.SQLite
1851 pDa.Fill(tmpDS, "prims"); 1830 pDa.Fill(tmpDS, "prims");
1852 sDa.Fill(tmpDS, "primshapes"); 1831 sDa.Fill(tmpDS, "primshapes");
1853 1832
1854 if (persistPrimInventories)
1855 iDa.Fill(tmpDS, "primitems"); 1833 iDa.Fill(tmpDS, "primitems");
1856 1834
1857 tDa.Fill(tmpDS, "terrain"); 1835 tDa.Fill(tmpDS, "terrain");
@@ -1874,7 +1852,6 @@ namespace OpenSim.Data.SQLite
1874 // pDa.Fill(tmpDS, "prims"); 1852 // pDa.Fill(tmpDS, "prims");
1875 // sDa.Fill(tmpDS, "primshapes"); 1853 // sDa.Fill(tmpDS, "primshapes");
1876 1854
1877 // if (persistPrimInventories)
1878 // iDa.Fill(tmpDS, "primitems"); 1855 // iDa.Fill(tmpDS, "primitems");
1879 1856
1880 // tDa.Fill(tmpDS, "terrain"); 1857 // tDa.Fill(tmpDS, "terrain");