]> git.pld-linux.org Git - packages/beagle.git/blob - beagle-sqlite.patch
- fix build with mono-2.8
[packages/beagle.git] / beagle-sqlite.patch
1 From 59f63233908b8ccee70251f698351014546d5765 Mon Sep 17 00:00:00 2001
2 From: Gabriel Burt <gabriel.burt@gmail.com>
3 Date: Thu, 07 Jan 2010 01:08:34 +0000
4 Subject: Update to build against Mono.Data.Sqlite 2.x
5
6 ---
7 index 9470a0a..82f7752 100644
8 --- a/Util/FSpotTools.cs
9 +++ b/Util/FSpotTools.cs
10 @@ -85,8 +85,12 @@ namespace Beagle.Util {
11                                                         while (reader == null) {
12                                                                 try {
13                                                                         reader = command.ExecuteReader ();
14 -                                                               } catch (SqliteBusyException) {
15 -                                                                       Thread.Sleep (50);
16 +                                                               } catch (SqliteException e) {
17 +                                                                       if (e.ErrorCode == SQLiteErrorCode.Busy) {
18 +                                                                               Thread.Sleep (50);
19 +                                                                       } else {
20 +                                                                               throw;
21 +                                                                       }
22                                                                 }
23                                                         }
24                                                         reader.Close ();
25 index f4be4c6..f747db5 100644
26 --- a/beagled/SqliteUtils.cs
27 +++ b/beagled/SqliteUtils.cs
28 @@ -55,8 +55,13 @@ namespace Beagle.Util {
29                                         try {
30                                                 ret = command.ExecuteNonQuery ();
31                                                 break;
32 -                                       } catch (SqliteBusyException ex) {
33 -                                               Thread.Sleep (50);
34 +                                       } catch (SqliteException ex) {
35 +                                               if (ex.ErrorCode == SQLiteErrorCode.Busy) {
36 +                                                       Thread.Sleep (50);
37 +                                               } else {
38 +                                                       Log.Error (ex, "SQL that caused the exception: {0}", command_text);
39 +                                                       throw;
40 +                                               }
41                                         } catch (Exception e) {
42                                                 Log.Error (e, "SQL that caused the exception: {0}", command_text);
43                                                 throw;
44 @@ -79,8 +84,13 @@ namespace Beagle.Util {
45                                 try {
46                                         ret = command.ExecuteNonQuery ();
47                                         break;
48 -                               } catch (SqliteBusyException ex) {
49 -                                       Thread.Sleep (50);
50 +                               } catch (SqliteException ex) {
51 +                                       if (ex.ErrorCode == SQLiteErrorCode.Busy) {
52 +                                               Thread.Sleep (50);
53 +                                       } else {
54 +                                               Log.Error (ex, "SQL that caused the exception: {0}", command.CommandText);
55 +                                               throw;
56 +                                       }
57                                 } catch (Exception e) {
58                                         Log.Error ( e, "SQL that caused the exception: {0}", command.CommandText);
59                                         throw;
60 @@ -96,8 +106,12 @@ namespace Beagle.Util {
61                         while (reader == null) {
62                                 try {
63                                         reader = command.ExecuteReader ();
64 -                               } catch (SqliteBusyException ex) {
65 -                                       Thread.Sleep (50);
66 +                               } catch (SqliteException ex) {
67 +                                       if (ex.ErrorCode == SQLiteErrorCode.Busy) {
68 +                                               Thread.Sleep (50);
69 +                                       } else {
70 +                                               throw;
71 +                                       }
72                                 }
73                         }
74                         return reader;
75 @@ -108,8 +122,12 @@ namespace Beagle.Util {
76                         while (true) {
77                                 try {
78                                         return reader.Read ();
79 -                               } catch (SqliteBusyException ex) {
80 -                                       Thread.Sleep (50);
81 +                               } catch (SqliteException ex) {
82 +                                       if (ex.ErrorCode == SQLiteErrorCode.Busy) {
83 +                                               Thread.Sleep (50);
84 +                                       } else {
85 +                                               throw;
86 +                                       }
87                                 }
88                         }
89                 }
90 --
91 cgit v0.8.3.1
This page took 0.059614 seconds and 3 git commands to generate.