diff options
author | Federico Di Gregorio <fog@initd.org> | 2005-10-22 06:59:31 +0000 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2005-10-22 06:59:31 +0000 |
commit | ef3430d24f3a1580a994e6dec8b5926a752efaed (patch) | |
tree | baa59cd9e3208147bc476eddf743088860287227 /psycopg/connection_int.c | |
parent | f687f2853ed619e4ee1b53f350cc31158e81e9cf (diff) | |
download | psycopg2-ef3430d24f3a1580a994e6dec8b5926a752efaed.tar.gz |
Implemented named cursors.
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r-- | psycopg/connection_int.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index ea1e9aa..9795e0e 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -191,7 +191,8 @@ conn_commit(connectionObject *self) pthread_mutex_lock(&self->lock); res = pq_commit(self); - + self->mark++; + pthread_mutex_unlock(&self->lock); Py_END_ALLOW_THREADS; @@ -209,7 +210,8 @@ conn_rollback(connectionObject *self) pthread_mutex_lock(&self->lock); res = pq_abort(self); - + self->mark++; + pthread_mutex_unlock(&self->lock); Py_END_ALLOW_THREADS; @@ -232,7 +234,8 @@ conn_switch_isolation_level(connectionObject *self, int level) res = pq_abort(self); } self->isolation_level = level; - + self->mark++; + Dprintf("conn_switch_isolation_level: switched to level %d", level); pthread_mutex_unlock(&self->lock); @@ -256,7 +259,7 @@ conn_set_client_encoding(connectionObject *self, char *enc) pthread_mutex_lock(&self->lock); /* set encoding, no encoding string is longer than 24 bytes */ - snprintf(query, 47, "SET client_encoding = '%s'", enc); + PyOS_snprintf(query, 47, "SET client_encoding = '%s'", enc); /* abort the current transaction, to set the encoding ouside of transactions */ |