Reverted MySQLDataStore.cs to not use static mutexes any more, patch didn't work anyway.

Added js to OpenSim.ini.example.
ThreadPoolClientBranch
Tedd Hansen 2008-02-05 12:18:50 +00:00
parent ca5aadfbff
commit 1d95f0521d
3 changed files with 31 additions and 44 deletions

View File

@ -50,7 +50,6 @@ namespace OpenSim.Framework.Data.MySQL
private const string m_landAccessListSelect = "select * from landaccesslist"; private const string m_landAccessListSelect = "select * from landaccesslist";
private DataSet m_dataSet; private DataSet m_dataSet;
private static object DBAccessLock = new object(); // Trying to use a static object because there might be other regions that keep modifying table
private MySqlDataAdapter m_primDataAdapter; private MySqlDataAdapter m_primDataAdapter;
private MySqlDataAdapter m_shapeDataAdapter; private MySqlDataAdapter m_shapeDataAdapter;
private MySqlDataAdapter m_itemsDataAdapter; private MySqlDataAdapter m_itemsDataAdapter;
@ -104,7 +103,7 @@ namespace OpenSim.Framework.Data.MySQL
TestTables(m_connection); TestTables(m_connection);
lock (DBAccessLock) lock (m_dataSet)
{ {
m_primTable = createPrimTable(); m_primTable = createPrimTable();
m_dataSet.Tables.Add(m_primTable); m_dataSet.Tables.Add(m_primTable);
@ -143,7 +142,7 @@ namespace OpenSim.Framework.Data.MySQL
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{ {
lock (DBAccessLock) lock (m_dataSet)
{ {
foreach (SceneObjectPart prim in obj.Children.Values) foreach (SceneObjectPart prim in obj.Children.Values)
{ {
@ -170,7 +169,7 @@ namespace OpenSim.Framework.Data.MySQL
DataTable shapes = m_shapeTable; DataTable shapes = m_shapeTable;
string selectExp = "SceneGroupID = '" + Util.ToRawUuidString(obj) + "'"; string selectExp = "SceneGroupID = '" + Util.ToRawUuidString(obj) + "'";
lock (DBAccessLock) lock (m_dataSet)
{ {
DataRow[] primRows = prims.Select(selectExp); DataRow[] primRows = prims.Select(selectExp);
foreach (DataRow row in primRows) foreach (DataRow row in primRows)
@ -226,7 +225,7 @@ namespace OpenSim.Framework.Data.MySQL
string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'"; string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'";
string orderByParent = "ParentID ASC"; string orderByParent = "ParentID ASC";
lock (DBAccessLock) lock (m_dataSet)
{ {
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
MainLog.Instance.Verbose("DATASTORE", MainLog.Instance.Verbose("DATASTORE",
@ -336,7 +335,7 @@ namespace OpenSim.Framework.Data.MySQL
MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
DataTable terrain = m_dataSet.Tables["terrain"]; DataTable terrain = m_dataSet.Tables["terrain"];
lock (DBAccessLock) lock (m_dataSet)
{ {
MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" +
" values(?RegionUUID, ?Revision, ?Heightfield)", m_connection); " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection);
@ -397,7 +396,7 @@ namespace OpenSim.Framework.Data.MySQL
public void RemoveLandObject(LLUUID globalID) public void RemoveLandObject(LLUUID globalID)
{ {
lock (DBAccessLock) lock (m_dataSet)
{ {
using (MySqlCommand cmd = new MySqlCommand("delete from land where UUID=?UUID", m_connection)) using (MySqlCommand cmd = new MySqlCommand("delete from land where UUID=?UUID", m_connection))
{ {
@ -422,7 +421,7 @@ namespace OpenSim.Framework.Data.MySQL
MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))");
System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900)); System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900));
lock (DBAccessLock) lock (m_dataSet)
{ {
DataTable land = m_landTable; DataTable land = m_landTable;
DataTable landaccesslist = m_landAccessListTable; DataTable landaccesslist = m_landAccessListTable;
@ -454,14 +453,14 @@ namespace OpenSim.Framework.Data.MySQL
landaccesslist.Rows.Add(newAccessRow); landaccesslist.Rows.Add(newAccessRow);
} }
Commit_NoLock();
} }
Commit();
} }
public List<LandData> LoadLandObjects(LLUUID regionUUID) public List<LandData> LoadLandObjects(LLUUID regionUUID)
{ {
List<LandData> landDataForRegion = new List<LandData>(); List<LandData> landDataForRegion = new List<LandData>();
lock (DBAccessLock) lock (m_dataSet)
{ {
DataTable land = m_landTable; DataTable land = m_landTable;
DataTable landaccesslist = m_landAccessListTable; DataTable landaccesslist = m_landAccessListTable;
@ -523,38 +522,26 @@ namespace OpenSim.Framework.Data.MySQL
m_connection.Open(); m_connection.Open();
} }
lock (DBAccessLock) lock (m_dataSet)
{ {
// Moved code to own sub that can be called directly by "StoreLandObject". // DisplayDataSet(m_dataSet, "Region DataSet");
// Problem is that:
// - StoreLandObject locks m_primDataAdapter.Update(m_primTable);
// - Some other function waits for lock m_shapeDataAdapter.Update(m_shapeTable);
// - StoreLandObject releases lock
// - Other function obtains lock if (persistPrimInventories)
// - StoreLandObject calls Commit that tries to take lock back {
// - When StoreLandObject's Commit finally gets lock the table has been changed and we crash m_itemsDataAdapter.Update(m_itemsTable);
Commit_NoLock(); }
m_terrainDataAdapter.Update(m_terrainTable);
m_landDataAdapter.Update(m_landTable);
m_landAccessListDataAdapter.Update(m_landAccessListTable);
m_dataSet.AcceptChanges();
} }
} }
private void Commit_NoLock()
{
// DisplayDataSet(m_dataSet, "Region DataSet");
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);
m_landAccessListDataAdapter.Update(m_landAccessListTable);
m_dataSet.AcceptChanges();
}
public void Shutdown() public void Shutdown()
{ {
@ -1231,7 +1218,7 @@ namespace OpenSim.Framework.Data.MySQL
// For now, we're just going to crudely remove all the previous inventory items // For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set. // no matter whether they have changed or not, and replace them with the current set.
lock (DBAccessLock) lock (m_dataSet)
{ {
RemoveItems(primID); RemoveItems(primID);

View File

@ -41,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
: base(scriptEngine) : base(scriptEngine)
{ {
base.m_scriptEngine = scriptEngine; base.m_scriptEngine = scriptEngine;
} }
private Compiler.LSL.Compiler LSLCompiler; private Compiler.LSL.Compiler LSLCompiler;

View File

@ -225,13 +225,14 @@ AsyncLLCommandLoopms=50
WriteScriptSourceToDebugFile=true WriteScriptSourceToDebugFile=true
; Specify default script compiler ; Specify default script compiler
; If you do not specify //cs, //vb or //lsl tag as the first characters of your script then the default compiler will be chosen ; If you do not specify //cs, //vb, //js or //lsl tag as the first characters of your script then the default compiler will be chosen
; Valid languages are: lsl, cs and vb ; Valid languages are: lsl, cs, js and vb
DefaultCompileLanguage=lsl DefaultCompileLanguage=lsl
; Specify what compilers are allowed to be used ; Specify what compilers are allowed to be used
; Valid languages are: lsl, cs and vb ; Note vb only works on Windows for now (Mono lacks VB compile support)
AllowedCompilers=lsl,cs,vb ; Valid languages are: lsl, cs, js and vb
AllowedCompilers=lsl,cs,js,vb
; Compile scripts with debugging ; Compile scripts with debugging
; Probably a thousand times slower, but gives you a line number when something goes wrong. ; Probably a thousand times slower, but gives you a line number when something goes wrong.