[beagle] Update to build against Mono.Data.Sqlite 2.x
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [beagle] Update to build against Mono.Data.Sqlite 2.x
- Date: Mon, 25 Jan 2010 19:11:24 +0000 (UTC)
commit 59f63233908b8ccee70251f698351014546d5765
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Jan 6 17:08:34 2010 -0800
Update to build against Mono.Data.Sqlite 2.x
beagle/Util/FSpotTools.cs | 8 ++++++--
beagle/beagled/SqliteUtils.cs | 34 ++++++++++++++++++++++++++--------
2 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/beagle/Util/FSpotTools.cs b/beagle/Util/FSpotTools.cs
index 9470a0a..82f7752 100644
--- a/beagle/Util/FSpotTools.cs
+++ b/beagle/Util/FSpotTools.cs
@@ -85,8 +85,12 @@ namespace Beagle.Util {
while (reader == null) {
try {
reader = command.ExecuteReader ();
- } catch (SqliteBusyException) {
- Thread.Sleep (50);
+ } catch (SqliteException e) {
+ if (e.ErrorCode == SQLiteErrorCode.Busy) {
+ Thread.Sleep (50);
+ } else {
+ throw;
+ }
}
}
reader.Close ();
diff --git a/beagle/beagled/SqliteUtils.cs b/beagle/beagled/SqliteUtils.cs
index f4be4c6..f747db5 100644
--- a/beagle/beagled/SqliteUtils.cs
+++ b/beagle/beagled/SqliteUtils.cs
@@ -55,8 +55,13 @@ namespace Beagle.Util {
try {
ret = command.ExecuteNonQuery ();
break;
- } catch (SqliteBusyException ex) {
- Thread.Sleep (50);
+ } catch (SqliteException ex) {
+ if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+ Thread.Sleep (50);
+ } else {
+ Log.Error (ex, "SQL that caused the exception: {0}", command_text);
+ throw;
+ }
} catch (Exception e) {
Log.Error (e, "SQL that caused the exception: {0}", command_text);
throw;
@@ -79,8 +84,13 @@ namespace Beagle.Util {
try {
ret = command.ExecuteNonQuery ();
break;
- } catch (SqliteBusyException ex) {
- Thread.Sleep (50);
+ } catch (SqliteException ex) {
+ if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+ Thread.Sleep (50);
+ } else {
+ Log.Error (ex, "SQL that caused the exception: {0}", command.CommandText);
+ throw;
+ }
} catch (Exception e) {
Log.Error ( e, "SQL that caused the exception: {0}", command.CommandText);
throw;
@@ -96,8 +106,12 @@ namespace Beagle.Util {
while (reader == null) {
try {
reader = command.ExecuteReader ();
- } catch (SqliteBusyException ex) {
- Thread.Sleep (50);
+ } catch (SqliteException ex) {
+ if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+ Thread.Sleep (50);
+ } else {
+ throw;
+ }
}
}
return reader;
@@ -108,8 +122,12 @@ namespace Beagle.Util {
while (true) {
try {
return reader.Read ();
- } catch (SqliteBusyException ex) {
- Thread.Sleep (50);
+ } catch (SqliteException ex) {
+ if (ex.ErrorCode == SQLiteErrorCode.Busy) {
+ Thread.Sleep (50);
+ } else {
+ throw;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]