summaryrefslogtreecommitdiff
path: root/psycopg/pqpath.h
diff options
context:
space:
mode:
authorJames Henstridge <james@jamesh.id.au>2008-01-10 06:14:20 +0000
committerJames Henstridge <james@jamesh.id.au>2008-01-10 06:14:20 +0000
commitd190d5918aed4757a79b0799679fecdaa92a234d (patch)
treeaed99b834328b553b912486da5a1553cf28dd490 /psycopg/pqpath.h
parent5fe08ae83e07aef2c7f9a56962d1ef28acf58b4d (diff)
downloadpsycopg2-d190d5918aed4757a79b0799679fecdaa92a234d.tar.gz
2007-12-23 James Henstridge <james@jamesh.id.au>
* psycopg/pqpath.c (pq_execute_command_locked): add an error argument to hold an error when no PGresult is returned by PQexec, rather than using pq_set_critical(). (pq_complete_error): new function that converts the error returned by pq_execute_command_locked() to a Python exception. (pq_begin_locked): add error argument. (pq_commit): use pq_complete_error(). (pq_abort): use pq_complete_error(). (pq_abort_locked): always call pq_set_critical() on error, and clear the error message from pq_execute_command_locked(). (pq_execute): use pq_complete_error() to handle the error from pq_begin_locked(). * psycopg/pqpath.c (pq_begin): remove unused function. * psycopg/connection_type.c (psyco_conn_commit): if conn_commit() raises an error, just return NULL, since it is now setting an exception itself. (psyco_conn_rollback): same here. * psycopg/connection_int.c (conn_commit): don't drop GIL and lock connection before calling pq_commit(). (conn_rollback): same here. (conn_close): use pq_abort_locked(). (conn_switch_isolation_level): same here. (conn_set_client_encoding): same here. * psycopg/pqpath.h: add prototype for pq_abort_locked(). * psycopg/pqpath.c (pq_commit): convert function to run with GIL held, and handle errors appropriately. (pq_abort): same here. (pq_abort_locked): new function to abort a locked connection. 2007-12-22 James Henstridge <james@jamesh.id.au> * psycopg/pqpath.c (pq_raise): add a "pgres" argument so we can generate nice errors not related to a particular cursor. (pq_execute): use pq_begin_locked() rather than pq_begin(). Use pq_raise() to handle any errors from it. * psycopg/pqpath.c (pq_execute_command_locked): helper function used to execute a command-style query on a locked connection. (pq_begin_locked): a variant of pq_begin() that uses pq_execute_command_locked(). (pq_begin): rewrite to use pq_begin_locked().
Diffstat (limited to 'psycopg/pqpath.h')
-rw-r--r--psycopg/pqpath.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/pqpath.h b/psycopg/pqpath.h
index 57be047..d55b0b6 100644
--- a/psycopg/pqpath.h
+++ b/psycopg/pqpath.h
@@ -32,8 +32,8 @@
/* exported functions */
extern int pq_fetch(cursorObject *curs);
extern int pq_execute(cursorObject *curs, const char *query, int async);
-extern int pq_begin(connectionObject *conn);
extern int pq_commit(connectionObject *conn);
+extern int pq_abort_locked(connectionObject *conn);
extern int pq_abort(connectionObject *conn);
extern int pq_is_busy(connectionObject *conn);
extern void pq_set_critical(connectionObject *conn, const char *msg);