From bbc7b5b84720624c9188ed2425fa09568ed1e443 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 24 Aug 2007 13:35:51 +0000 Subject: Added temporary fix for the sqlite datastore exception in windows .Net, Added a Try catch block around "shapeDa.Fill(ds.Tables["primshapes"]);" line. Seems if the database file is empty (ie opensim has just created it or nothing has been stored in it yet.) then the exception will be fired and catch, then opensim can continue and have no problems (it will still save prims fine), then on next restart if the database file has entries in it, the exception will no longer be thrown. --- .../OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs') diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 440ca3a..7d45a30 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -57,14 +57,23 @@ namespace OpenSim.DataStore.MonoSqliteStorage // TODO: see if the linkage actually holds. // primDa.FillSchema(ds, SchemaType.Source, "PrimSchema"); TestTables(conn); - + ds.Tables.Add(createPrimTable()); primDa.Fill(ds.Tables["prims"]); setupPrimCommands(primDa, conn); MainLog.Instance.Verbose("DATASTORE", "Populated Prim Definitions"); ds.Tables.Add(createShapeTable()); - shapeDa.Fill(ds.Tables["primshapes"]); + + try + { + shapeDa.Fill(ds.Tables["primshapes"]); + } + catch (Exception) + { + MainLog.Instance.Verbose("DATASTORE", "Caught fill error on primshapes table"); + } + setupShapeCommands(shapeDa, conn); MainLog.Instance.Verbose("DATASTORE", "Populated Prim Shapes"); -- cgit v1.1