From a73d87ef1651ac1e935e0cfebed99282a69c3941 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 18 Jul 2008 20:50:47 +0000
Subject: 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.
---
OpenSim/Data/MSSQL/MSSQLDataStore.cs | 22 +------------------
OpenSim/Data/MySQL/MySQLDataStore.cs | 23 +-------------------
OpenSim/Data/NHibernate/NHibernateRegionData.cs | 2 +-
OpenSim/Data/Null/NullDataStore.cs | 2 +-
OpenSim/Data/SQLite/SQLiteRegionData.cs | 25 +---------------------
OpenSim/Region/Application/OpenSimBase.cs | 9 ++++----
.../Region/ClientStack/RegionApplicationBase.cs | 9 +++-----
.../Environment/Interfaces/IRegionDataStore.cs | 3 +--
OpenSim/Region/Environment/StorageManager.cs | 6 +++---
OpenSim/Tools/Export/OpenSimExport.cs | 2 +-
10 files changed, 17 insertions(+), 86 deletions(-)
(limited to 'OpenSim')
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
private DataTable m_landAccessListTable;
/// Temporary attribute while this is experimental
- private bool persistPrimInventories;
/***********************************************************************
*
@@ -83,13 +82,11 @@ namespace OpenSim.Data.MSSQL
/// see IRegionDataStore
///
///
- ///
- public void Initialise(string connectionString, bool persistPrimInventories)
+ public void Initialise(string connectionString)
{
// Instance.Initialise("", true);
m_dataSet = new DataSet();
- this.persistPrimInventories = persistPrimInventories;
m_log.Info("[REGION DB]: MSSql - connecting: " + connectionString);
m_connection = new SqlConnection(connectionString);
@@ -126,13 +123,10 @@ namespace OpenSim.Data.MSSQL
setupShapeCommands(m_shapeDataAdapter, m_connection);
m_shapeDataAdapter.Fill(m_shapeTable);
- if (persistPrimInventories)
- {
m_itemsTable = createItemsTable();
m_dataSet.Tables.Add(m_itemsTable);
SetupItemsCommands(m_itemsDataAdapter, m_connection);
m_itemsDataAdapter.Fill(m_itemsTable);
- }
m_terrainTable = createTerrainTable();
m_dataSet.Tables.Add(m_terrainTable);
@@ -218,10 +212,7 @@ namespace OpenSim.Data.MSSQL
shapeRow.Delete();
}
- if (persistPrimInventories)
- {
RemoveItems(new LLUUID((string)row["UUID"]));
- }
// Remove prim row
row.Delete();
@@ -317,11 +308,8 @@ namespace OpenSim.Data.MSSQL
createdObjects[new LLUUID(objID)].AddPart(prim);
}
- if (persistPrimInventories)
- {
LoadItems(prim);
}
- }
catch (Exception e)
{
m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
@@ -589,10 +577,7 @@ namespace OpenSim.Data.MSSQL
m_primDataAdapter.Update(m_primTable);
m_shapeDataAdapter.Update(m_shapeTable);
- if (persistPrimInventories)
- {
m_itemsDataAdapter.Update(m_itemsTable);
- }
m_terrainDataAdapter.Update(m_terrainTable);
m_landDataAdapter.Update(m_landTable);
@@ -1378,9 +1363,6 @@ namespace OpenSim.Data.MSSQL
///
public void StorePrimInventory(LLUUID primID, ICollection items)
{
- if (!persistPrimInventories)
- return;
-
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
// For now, we're just going to crudely remove all the previous inventory items
@@ -1749,7 +1731,6 @@ namespace OpenSim.Data.MSSQL
pDa.Fill(tmpDS, "prims");
sDa.Fill(tmpDS, "primshapes");
- if (persistPrimInventories)
iDa.Fill(tmpDS, "primitems");
tDa.Fill(tmpDS, "terrain");
@@ -1765,7 +1746,6 @@ namespace OpenSim.Data.MSSQL
pDa.Fill(tmpDS, "prims");
sDa.Fill(tmpDS, "primshapes");
- if (persistPrimInventories)
iDa.Fill(tmpDS, "primitems");
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
private DataTable m_landAccessListTable;
private DataTable m_regionSettingsTable;
- /// Temporary attribute while this is experimental
- private bool persistPrimInventories;
-
/***********************************************************************
*
* Public Interface Functions
@@ -105,13 +102,11 @@ namespace OpenSim.Data.MySQL
/// see IRegionDataStore
///
///
- ///
- public void Initialise(string connectionString, bool persistPrimInventories)
+ public void Initialise(string connectionString)
{
m_connectionString = connectionString;
m_dataSet = new DataSet();
- this.persistPrimInventories = persistPrimInventories;
int passPosition = 0;
int passEndPosition = 0;
@@ -184,13 +179,10 @@ namespace OpenSim.Data.MySQL
m_shapeDataAdapter.Fill(m_shapeTable);
- if (persistPrimInventories)
- {
m_itemsTable = createItemsTable();
m_dataSet.Tables.Add(m_itemsTable);
SetupItemsCommands(m_itemsDataAdapter, m_connection);
m_itemsDataAdapter.Fill(m_itemsTable);
- }
m_terrainTable = createTerrainTable();
m_dataSet.Tables.Add(m_terrainTable);
@@ -429,10 +421,7 @@ namespace OpenSim.Data.MySQL
shapeRow.Delete();
}
- if (persistPrimInventories)
- {
RemoveItems(uuid);
- }
// Remove prim row
row.Delete();
@@ -527,11 +516,8 @@ namespace OpenSim.Data.MySQL
createdObjects[new LLUUID(objID)].AddPart(prim);
}
- if (persistPrimInventories)
- {
LoadItems(prim);
}
- }
catch (Exception e)
{
m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
@@ -827,10 +813,7 @@ namespace OpenSim.Data.MySQL
m_primDataAdapter.Update(m_primTable);
m_shapeDataAdapter.Update(m_shapeTable);
- if (persistPrimInventories)
- {
m_itemsDataAdapter.Update(m_itemsTable);
- }
m_terrainDataAdapter.Update(m_terrainTable);
m_landDataAdapter.Update(m_landTable);
@@ -1812,9 +1795,6 @@ namespace OpenSim.Data.MySQL
///
public void StorePrimInventory(LLUUID primID, ICollection items)
{
- if (!persistPrimInventories)
- return;
-
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
// For now, we're just going to crudely remove all the previous inventory items
@@ -2241,7 +2221,6 @@ namespace OpenSim.Data.MySQL
// pDa.Fill(tmpDS, "prims");
// sDa.Fill(tmpDS, "primshapes");
- // if (persistPrimInventories)
// iDa.Fill(tmpDS, "primitems");
// 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
// Initialise("SQLiteDialect;SqliteClientDriver;URI=file:OpenSim.db,version=3", true);
// }
- public void Initialise(string connect, bool persistpriminventories)
+ public void Initialise(string connect)
{
// Split out the dialect, driver, and connect string
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
///
public class NullDataStore : IRegionDataStore
{
- public void Initialise(string dbfile, bool persistPrimInventories)
+ public void Initialise(string dbfile)
{
return;
}
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
private String m_connectionString;
// Temporary attribute while this is experimental
- private bool persistPrimInventories;
/***********************************************************************
*
@@ -84,11 +83,9 @@ namespace OpenSim.Data.SQLite
///
///
/// the connection string
- /// ?
- public void Initialise(string connectionString, bool persistPrimInventories)
+ public void Initialise(string connectionString)
{
m_connectionString = connectionString;
- this.persistPrimInventories = persistPrimInventories;
ds = new DataSet();
@@ -137,12 +134,9 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createShapeTable());
setupShapeCommands(shapeDa, m_conn);
- if (persistPrimInventories)
- {
ds.Tables.Add(createItemsTable());
setupItemsCommands(itemsDa, m_conn);
itemsDa.Fill(ds.Tables["primitems"]);
- }
ds.Tables.Add(createTerrainTable());
setupTerrainCommands(terrainDa, m_conn);
@@ -267,10 +261,7 @@ namespace OpenSim.Data.SQLite
shapeRow.Delete();
}
- if (persistPrimInventories)
- {
RemoveItems(uuid);
- }
// Remove prim row
row.Delete();
@@ -367,11 +358,8 @@ namespace OpenSim.Data.SQLite
createdObjects[new LLUUID(objID)].AddPart(prim);
}
- if (persistPrimInventories)
- {
LoadItems(prim);
}
- }
catch (Exception e)
{
m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
@@ -615,10 +603,7 @@ namespace OpenSim.Data.SQLite
primDa.Update(ds, "prims");
shapeDa.Update(ds, "primshapes");
- if (persistPrimInventories)
- {
itemsDa.Update(ds, "primitems");
- }
terrainDa.Update(ds, "terrain");
landDa.Update(ds, "land");
@@ -1475,9 +1460,6 @@ namespace OpenSim.Data.SQLite
///
public void StorePrimInventory(LLUUID primID, ICollection items)
{
- if (!persistPrimInventories)
- return;
-
m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
DataTable dbItems = ds.Tables["primitems"];
@@ -1779,8 +1761,6 @@ namespace OpenSim.Data.SQLite
// m_log.Warn("[REGION DB]: Shapes Table Already Exists");
// }
- // if (persistPrimInventories)
- // {
// try
// {
// icmd.ExecuteNonQuery();
@@ -1789,7 +1769,6 @@ namespace OpenSim.Data.SQLite
// {
// m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists");
// }
- // }
// try
// {
@@ -1851,7 +1830,6 @@ namespace OpenSim.Data.SQLite
pDa.Fill(tmpDS, "prims");
sDa.Fill(tmpDS, "primshapes");
- if (persistPrimInventories)
iDa.Fill(tmpDS, "primitems");
tDa.Fill(tmpDS, "terrain");
@@ -1874,7 +1852,6 @@ namespace OpenSim.Data.SQLite
// pDa.Fill(tmpDS, "prims");
// sDa.Fill(tmpDS, "primshapes");
- // if (persistPrimInventories)
// iDa.Fill(tmpDS, "primitems");
// tDa.Fill(tmpDS, "terrain");
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 910ec55..05e4f46 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -300,9 +300,8 @@ namespace OpenSim
}
m_storageConnectionString
= startupConfig.GetString("storage_connection_string", "URI=file:OpenSim.db,version=3");
- m_storagePersistPrimInventories
- = startupConfig.GetBoolean("storage_prim_inventories", true);
-
+ m_estateConnectionString
+ = startupConfig.GetString("estate_connection_string", m_storageConnectionString);
m_scriptEngine = startupConfig.GetString("script_engine", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
m_assetStorage = startupConfig.GetString("asset_database", "local");
m_clientstackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
@@ -555,9 +554,9 @@ namespace OpenSim
return clientServer;
}
- protected override StorageManager CreateStorageManager(string connectionstring)
+ protected override StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring)
{
- return new StorageManager(m_storageDll, connectionstring, m_storagePersistPrimInventories);
+ return new StorageManager(m_storageDll, connectionstring, estateconnectionstring);
}
protected override ClientStackManager CreateClientStackManager()
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index dadaf88..3e941cf 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -62,13 +62,10 @@ namespace OpenSim.Region.ClientStack
protected StorageManager m_storageManager;
protected string m_storageConnectionString;
+ protected string m_estateConnectionString;
protected ClientStackManager m_clientStackManager;
- // An attribute to indicate whether prim inventories should be persisted.
- // Probably will be temporary until this stops being experimental.
- protected bool m_storagePersistPrimInventories;
-
public SceneManager SceneManager
{
get { return m_sceneManager; }
@@ -78,7 +75,7 @@ namespace OpenSim.Region.ClientStack
{
base.Startup();
- m_storageManager = CreateStorageManager(m_storageConnectionString);
+ m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString);
m_clientStackManager = CreateClientStackManager();
@@ -101,7 +98,7 @@ namespace OpenSim.Region.ClientStack
// protected abstract ConsoleBase CreateConsole();
protected abstract PhysicsScene GetPhysicsScene();
- protected abstract StorageManager CreateStorageManager(string connectionstring);
+ protected abstract StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring);
protected abstract ClientStackManager CreateClientStackManager();
protected PhysicsScene GetPhysicsScene(string engine, string meshEngine, IConfigSource config)
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index 0316f20..ad5983c 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -39,8 +39,7 @@ namespace OpenSim.Region.Environment.Interfaces
///
/// The file to save the database to (may not be applicable). Alternatively,
/// a connection string for the database
- /// Temporary switch while this option is immature
- void Initialise(string filename, bool persistPrimInventories);
+ void Initialise(string filename);
///
/// Stores all object's details apart from inventory
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index 768e12c..36c9196 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment
m_dataStore = storage;
}
- public StorageManager(string dllName, string connectionstring, bool persistPrimInventories)
+ public StorageManager(string dllName, string connectionstring, string estateconnectionstring)
{
m_log.Info("[DATASTORE]: Attempting to load " + dllName);
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment
{
IRegionDataStore plug =
(IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
- plug.Initialise(connectionstring, persistPrimInventories);
+ plug.Initialise(connectionstring);
m_dataStore = plug;
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment
{
IEstateDataStore estPlug =
(IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
- estPlug.Initialise(connectionstring);
+ estPlug.Initialise(estateconnectionstring);
m_estateDataStore = estPlug;
}
diff --git a/OpenSim/Tools/Export/OpenSimExport.cs b/OpenSim/Tools/Export/OpenSimExport.cs
index 1e7db51..f469d91 100644
--- a/OpenSim/Tools/Export/OpenSimExport.cs
+++ b/OpenSim/Tools/Export/OpenSimExport.cs
@@ -54,7 +54,7 @@ namespace OpenSimExport
sman = new StorageManager(
startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"),
startup.GetString("storage_connection_string", String.Empty),
- false
+ startup.GetString("estate_connection_string", String.Empty)
);
}
--
cgit v1.1