diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index b25924c7e7..54f39bbba7 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs @@ -50,7 +50,6 @@ namespace OpenSim.Framework.Data.MySQL private const string m_landAccessListSelect = "select * from landaccesslist"; 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_shapeDataAdapter; private MySqlDataAdapter m_itemsDataAdapter; @@ -104,7 +103,7 @@ namespace OpenSim.Framework.Data.MySQL TestTables(m_connection); - lock (DBAccessLock) + lock (m_dataSet) { m_primTable = createPrimTable(); m_dataSet.Tables.Add(m_primTable); @@ -143,7 +142,7 @@ namespace OpenSim.Framework.Data.MySQL public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) { - lock (DBAccessLock) + lock (m_dataSet) { foreach (SceneObjectPart prim in obj.Children.Values) { @@ -170,7 +169,7 @@ namespace OpenSim.Framework.Data.MySQL DataTable shapes = m_shapeTable; string selectExp = "SceneGroupID = '" + Util.ToRawUuidString(obj) + "'"; - lock (DBAccessLock) + lock (m_dataSet) { DataRow[] primRows = prims.Select(selectExp); foreach (DataRow row in primRows) @@ -226,7 +225,7 @@ namespace OpenSim.Framework.Data.MySQL string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'"; string orderByParent = "ParentID ASC"; - lock (DBAccessLock) + lock (m_dataSet) { DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); MainLog.Instance.Verbose("DATASTORE", @@ -336,7 +335,7 @@ namespace OpenSim.Framework.Data.MySQL MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); DataTable terrain = m_dataSet.Tables["terrain"]; - lock (DBAccessLock) + lock (m_dataSet) { MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection); @@ -397,7 +396,7 @@ namespace OpenSim.Framework.Data.MySQL public void RemoveLandObject(LLUUID globalID) { - lock (DBAccessLock) + lock (m_dataSet) { 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! :))"); System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900)); - lock (DBAccessLock) + lock (m_dataSet) { DataTable land = m_landTable; DataTable landaccesslist = m_landAccessListTable; @@ -454,14 +453,14 @@ namespace OpenSim.Framework.Data.MySQL landaccesslist.Rows.Add(newAccessRow); } - Commit_NoLock(); } + Commit(); } public List LoadLandObjects(LLUUID regionUUID) { List landDataForRegion = new List(); - lock (DBAccessLock) + lock (m_dataSet) { DataTable land = m_landTable; DataTable landaccesslist = m_landAccessListTable; @@ -523,38 +522,26 @@ namespace OpenSim.Framework.Data.MySQL m_connection.Open(); } - lock (DBAccessLock) + lock (m_dataSet) { - // Moved code to own sub that can be called directly by "StoreLandObject". - // Problem is that: - // - StoreLandObject locks - // - Some other function waits for lock - // - StoreLandObject releases lock - // - Other function obtains lock - // - StoreLandObject calls Commit that tries to take lock back - // - When StoreLandObject's Commit finally gets lock the table has been changed and we crash - 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(); } } - 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() { @@ -1231,7 +1218,7 @@ namespace OpenSim.Framework.Data.MySQL // 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. - lock (DBAccessLock) + lock (m_dataSet) { RemoveItems(primID); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 4e20d95872..61da6ef655 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -41,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine : base(scriptEngine) { base.m_scriptEngine = scriptEngine; - } private Compiler.LSL.Compiler LSLCompiler; diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 366978d929..f406595125 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -225,13 +225,14 @@ AsyncLLCommandLoopms=50 WriteScriptSourceToDebugFile=true ; 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 -; Valid languages are: lsl, cs and vb +; 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, js and vb DefaultCompileLanguage=lsl ; Specify what compilers are allowed to be used -; Valid languages are: lsl, cs and vb -AllowedCompilers=lsl,cs,vb +; Note vb only works on Windows for now (Mono lacks VB compile support) +; Valid languages are: lsl, cs, js and vb +AllowedCompilers=lsl,cs,js,vb ; Compile scripts with debugging ; Probably a thousand times slower, but gives you a line number when something goes wrong.