Code

utils dbi: Added sdb_dbi_client_check_conn().
[sysdb.git] / src / include / utils / dbi.h
index 77d004296d333acaefc7460677a246765e182423..c2490410de8b5a38cd66b8c89db85f0e1b9bd1df 100644 (file)
@@ -113,6 +113,17 @@ sdb_dbi_client_set_options(sdb_dbi_client_t *client,
 int
 sdb_dbi_client_connect(sdb_dbi_client_t *client);
 
+/*
+ * sdb_dbi_client_check_conn:
+ * Check the database-connection and try to reconnect if that fails.
+ *
+ * Returns:
+ *  - 0 on success (the connection is connected after the call)
+ *  - a negative value else (failed to reconnect)
+ */
+int
+sdb_dbi_client_check_conn(sdb_dbi_client_t *client);
+
 /*
  * sdb_dbi_exec_query:
  * Execute an SQL query on the database. The specified 'callback' will be