]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Setup SQLite busy handler before doing queries.
authorKern Sibbald <kern@sibbald.com>
Wed, 26 Sep 2007 21:21:35 +0000 (21:21 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 26 Sep 2007 21:21:35 +0000 (21:21 +0000)
kes  Don't overwrite error message in check_tables_version.
kes  Unlock batch insert tables with same calls used elsewhere.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5662 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/sql.c
bacula/src/cats/sql_create.c
bacula/src/cats/sqlite.c
bacula/technotes-2.3

index 10bfaf3085f253171cff7b51dd9cdfd74b72846b..8a61c449d9a90062c3a7ca6b863823163d4295dd 100644 (file)
@@ -115,7 +115,6 @@ bool check_tables_version(JCR *jcr, B_DB *mdb)
 
    bacula_db_version = 0;
    if (!db_sql_query(mdb, query, int_handler, (void *)&bacula_db_version)) {
-      Mmsg(mdb->errmsg, "Database not created or server not running.\n");
       Jmsg(jcr, M_FATAL, 0, "%s", mdb->errmsg);
       return false;
    }
index c619146c4d40db9008aa9bfd68ff912ae6aba0ba..5c9c11fa5a3c6e57499c97452635aa1ead3ae337 100644 (file)
@@ -795,7 +795,7 @@ bool db_write_batch_file_records(JCR *jcr)
    
    if (!db_sql_query(jcr->db_batch,sql_batch_fill_filename_query, NULL,NULL)) {
       Jmsg(jcr,M_FATAL,0,"Can't fill Filename table %s\n",jcr->db_batch->errmsg);
-      QUERY_DB(jcr, jcr->db_batch, sql_batch_unlock_tables_query);
+      db_sql_query(jcr->db_batch, sql_batch_unlock_tables_query, NULL, NULL);
       return false;            
    }
 
index 9b0ede7ac9878d2cb5d04eb2abc138d7a4bcc3c0..9459f3b8b5aa33d210a351ac05058cefa1cf83bd 100644 (file)
@@ -211,6 +211,13 @@ db_open_database(JCR *jcr, B_DB *mdb)
    mdb->connected = true;
    free(db_name);
 
+   /* set busy handler to wait when we use mult_db_connections = 1 */
+#ifdef HAVE_SQLITE3
+   sqlite3_busy_handler(mdb->db, my_busy_handler, NULL);
+#else
+   sqlite_busy_handler(mdb->db, my_busy_handler, NULL);
+#endif
+
 #if  defined(HAVE_SQLITE3) && defined(SQLITE3_INIT_QUERY)
    db_sql_query(mdb, SQLITE3_INIT_QUERY, NULL, NULL);
 #endif
@@ -220,12 +227,6 @@ db_open_database(JCR *jcr, B_DB *mdb)
       return 0;
    }
 
-   /* set busy handler to wait when we use mult_db_connections = 1 */
-#ifdef HAVE_SQLITE3
-   sqlite3_busy_handler(mdb->db, my_busy_handler, NULL);
-#else
-   sqlite_busy_handler(mdb->db, my_busy_handler, NULL);
-#endif
 
    V(mutex);
    return 1;
index c64ba8795beeb4db44ccc37d3d8975fcf37b566a..2aec7b22c4fee37410ff597cbceeda1557448300 100644 (file)
@@ -2,6 +2,9 @@
 
 General:
 26Sep07
+kes  Setup SQLite busy handler before doing queries.
+kes  Don't overwrite error message in check_tables_version.
+kes  Unlock batch insert tables with same calls used elsewhere.
 kes  Allow starting 59 jobs a second.
 kes  Make SD session key more random.
 kes  Add retry for SQLite opening db if it fails.