summaryrefslogtreecommitdiff
path: root/extra/beagle/beagle-0.3.9-mono-data-sqlite-2.patch
blob: ef090be9e4196c3aaa5f2c7d4e5780a49945905a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- beagle-0.3.9/Util/FSpotTools.cs.orig	2010-01-30 14:45:38.000000000 +0100
+++ beagle-0.3.9/Util/FSpotTools.cs	2010-01-30 14:47:00.000000000 +0100
@@ -85,8 +85,12 @@
 							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 ();
--- beagle-0.3.9/beagled/SqliteUtils.cs.orig	2010-01-30 14:47:14.000000000 +0100
+++ beagle-0.3.9/beagled/SqliteUtils.cs	2010-01-30 14:53:16.000000000 +0100
@@ -55,8 +55,13 @@
 					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 @@
 				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 @@
 			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 @@
 			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;
+          }
 				}
 			}
 		}