aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2007-09-11 05:26:14 +0000
committerSean Dague2007-09-11 05:26:14 +0000
commit207bf2e4cfc68287cd47516fce7aa3f6025af86e (patch)
treef857a05b469bc600ebd5ce3940c7cff6fc0f4a4c
parentTrying some locks on asset database access. (diff)
downloadopensim-SC_OLD-207bf2e4cfc68287cd47516fce7aa3f6025af86e.zip
opensim-SC_OLD-207bf2e4cfc68287cd47516fce7aa3f6025af86e.tar.gz
opensim-SC_OLD-207bf2e4cfc68287cd47516fce7aa3f6025af86e.tar.bz2
opensim-SC_OLD-207bf2e4cfc68287cd47516fce7aa3f6025af86e.tar.xz
add DeleteAsset
this also moves commit points around a bit for debuging, though this will change back now the MW has worked out synchronization
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs24
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
index f50cc03..aef9350 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs
@@ -121,11 +121,8 @@ namespace OpenSim.Framework.Data.SQLite
121 { 121 {
122 fillAssetRow(row, asset); 122 fillAssetRow(row, asset);
123 } 123 }
124 if (ds.HasChanges()) { 124 da.Update(ds, "assets");
125 DataSet changed = ds.GetChanges(); 125 ds.AcceptChanges();
126 da.Update(changed, "assets");
127 ds.AcceptChanges();
128 }
129 } 126 }
130 127
131 public bool ExistsAsset(LLUUID uuid) 128 public bool ExistsAsset(LLUUID uuid)
@@ -133,15 +130,22 @@ namespace OpenSim.Framework.Data.SQLite
133 DataRow row = ds.Tables["assets"].Rows.Find(uuid); 130 DataRow row = ds.Tables["assets"].Rows.Find(uuid);
134 return (row != null); 131 return (row != null);
135 } 132 }
133
134 public void DeleteAsset(LLUUID uuid)
135 {
136 DataRow row = ds.Tables["assets"].Rows.Find(uuid);
137 if (row != null) {
138 row.Delete();
139 }
140 da.Update(ds, "assets");
141 ds.AcceptChanges();
142 }
136 143
137 public void CommitAssets() // force a sync to the database 144 public void CommitAssets() // force a sync to the database
138 { 145 {
139 MainLog.Instance.Verbose("AssetStorage", "Attempting commit"); 146 MainLog.Instance.Verbose("AssetStorage", "Attempting commit");
140 if (ds.HasChanges()) { 147 // da.Update(ds, "assets");
141 DataSet changed = ds.GetChanges(); 148 // ds.AcceptChanges();
142 da.Update(changed, "assets");
143 ds.AcceptChanges();
144 }
145 } 149 }
146 150
147 /*********************************************************************** 151 /***********************************************************************