aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-17 23:24:41 +0100
committerJustin Clark-Casey (justincc)2011-08-17 23:24:41 +0100
commit6b51d8a10e44eed7c39b58aab256789ab188ecca (patch)
tree8194d49b020d64dbf13315b1500e880a3b30d7c3 /OpenSim/Data
parentFor now, supress 'OH NOES' warnings given by HGInventoryBroker.CacheInventory... (diff)
downloadopensim-SC_OLD-6b51d8a10e44eed7c39b58aab256789ab188ecca.zip
opensim-SC_OLD-6b51d8a10e44eed7c39b58aab256789ab188ecca.tar.gz
opensim-SC_OLD-6b51d8a10e44eed7c39b58aab256789ab188ecca.tar.bz2
opensim-SC_OLD-6b51d8a10e44eed7c39b58aab256789ab188ecca.tar.xz
In the asset service, check that an asset exists before attempting to store it.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index e740232..a743479 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -251,12 +251,14 @@ namespace OpenSim.Data.MySQL
251 } 251 }
252 252
253 /// <summary> 253 /// <summary>
254 /// check if the asset UUID exist in database 254 /// Check if the asset exists in the database
255 /// </summary> 255 /// </summary>
256 /// <param name="uuid">The asset UUID</param> 256 /// <param name="uuid">The asset UUID</param>
257 /// <returns>true if exist.</returns> 257 /// <returns>true if it exists, false otherwise.</returns>
258 override public bool ExistsAsset(UUID uuid) 258 override public bool ExistsAsset(UUID uuid)
259 { 259 {
260// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
261
260 bool assetExists = false; 262 bool assetExists = false;
261 263
262 lock (m_dbLock) 264 lock (m_dbLock)
@@ -273,7 +275,10 @@ namespace OpenSim.Data.MySQL
273 using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 275 using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
274 { 276 {
275 if (dbReader.Read()) 277 if (dbReader.Read())
278 {
279// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
276 assetExists = true; 280 assetExists = true;
281 }
277 } 282 }
278 } 283 }
279 catch (Exception e) 284 catch (Exception e)