PGG(num_links)--;
}
+static void _be_quiet(void * arg, const char * message)
+{
+}
+
static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
- /*
- PGresult *pg_result;
- ExecStatusType status;
- */
+ PQnoticeProcessor old_notice_hook;
- PQexec(link,"BEGIN;ROLLBACK;");
+ /* we set the PQsetNoticeProcessor to avoid the stupid
+ * "NOTICE: BEGIN: already a transaction in progress"
+ * message
+ */
- /* maybe do error handling later....
- pg_result = PQexec(link,"BEGIN;ROLLBACK;");
-
- if (pg_result) {
- status = PQresultStatus(pg_result);
- } else {
- status = (ExecStatusType) PQstatus(link);
- }
- */
+ old_notice_hook = PQsetNoticeProcessor(link, _be_quiet, NULL);
+ PQexec(link,"BEGIN;ROLLBACK;");
+ PQsetNoticeProcessor(link, old_notice_hook, NULL);
return 0;
}