Skip site navigation (1) Skip section navigation (2)

Transaction Isolation Level

From: "Jason Koeninger" <jkoenin(at)jjcc(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Transaction Isolation Level
Date: 2002-08-11 00:08:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
The reporting system in my current project has the need for serialized 
transactions so numbers can be consistent coming from two queries 
within one transaction.  Using a psql command line, I can test the 
functionality I need using:

set transaction isolation level serializable;
select count(*) from mytable;
*** Perform insert on mytable from another connection here
select count(*) from mytable;

Both selects should give me the same result (which they do).  The problem 
I'm having is when I try to translate this into ODBC.  It appears from the 
driver code that the ODBC driver automatically calls BEGIN when not in 
autocommit mode and only does it for a certain set of functions (insert, 
update, delete, grant, revoke, and a couple others I'm forgetting).  
Consequently, the "set transaction" statement executed from an ODBC 
application is useless because it's not done inside the current transaction.
The normal solution would be to use SQLSetConnectOption with 
ODBC driver ignores those settings (according to the source).  

So, I'm wondering how to get a serialized transaction through ODBC 
without making changes to the driver source.  


Jason Koeninger
J&J Computer Consulting

pgsql-odbc by date

Next:From: Oleg GrodzevichDate: 2002-08-15 06:43:39
Subject: BEGIN in windows ODBC driver
Previous:From: Markus WollnyDate: 2002-08-10 18:42:44
Subject: Re: Severe problems with ColdFusion 5, ODBC and PostgreSQL 7.2.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group