From 15423539f98d47201a819e35f80b0c30ee459556 Mon Sep 17 00:00:00 2001
From: MW
Date: Mon, 10 Sep 2007 06:45:54 +0000
Subject: hooked up sdague new sqlite asset database provider to the old asset
system. So we can still use sqlite for assets while we wait for the rest of
the new asset system to be wrote. Needs more testing, so if it causes
problems will have to swap back to db4o.
---
OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Framework/Data.SQLite')
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
index 9138673..b53076c 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
@@ -34,13 +34,14 @@ using System.Data.SqlTypes;
using Mono.Data.SqliteClient;
using OpenSim.Framework.Console;
using OpenSim.Framework.Types;
+using OpenSim.Framework.Interfaces;
namespace OpenSim.Framework.Data.SQLite
{
///
/// A User storage interface for the DB4o database system
///
- public class SQLiteAssetData : SQLiteBase
+ public class SQLiteAssetData : SQLiteBase, IAssetProvider
{
///
/// The database manager
@@ -64,7 +65,15 @@ namespace OpenSim.Framework.Data.SQLite
ds.Tables.Add(createAssetsTable());
setupAssetCommands(da, conn);
- da.Fill(ds.Tables["assets"]);
+ try
+ {
+ da.Fill(ds.Tables["assets"]);
+ }
+ catch (Exception)
+ {
+ MainLog.Instance.Verbose("AssetStorage", "Caught fill error on asset table");
+ }
+
return;
}
@@ -172,7 +181,14 @@ namespace OpenSim.Framework.Data.SQLite
{
row["UUID"] = asset.FullID;
row["Name"] = asset.Name;
- row["Description"] = asset.Description;
+ if (asset.Description != null)
+ {
+ row["Description"] = asset.Description;
+ }
+ else
+ {
+ row["Description"] = " ";
+ }
row["Type"] = asset.Type;
row["InvType"] = asset.InvType;
row["Local"] = asset.Local;
--
cgit v1.1