Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C69CB63475D for ; Sat, 4 Apr 2009 04:02:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42857-03-8 for ; Sat, 4 Apr 2009 04:02:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 8A65A635E63 for ; Sat, 4 Apr 2009 04:01:14 -0300 (ADT) Received: (qmail 31116 invoked by uid 512); 4 Apr 2009 07:01:10 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 4 Apr 2009 07:01:10 -0000 Received: from unknown (HELO ?192.168.11.3?) (219.61.40.6) by sd.tpf.co.jp with SMTP; 4 Apr 2009 07:01:10 -0000 Message-ID: <49D705B4.5090802@tpf.co.jp> Date: Sat, 04 Apr 2009 16:01:08 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: olivier dorie CC: pgsql-odbc@postgresql.org Subject: Re: driver ODBC-PostreSQL, cursor and transaction isolation level References: <056F3845699645D39CF3C392BD754BEA@ign.fr> In-Reply-To: <056F3845699645D39CF3C392BD754BEA@ign.fr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.125 tagged_above=0 required=5 tests=DNS_FROM_RFC_BOGUSMX=2.125 X-Spam-Level: ** X-Archive-Number: 200904/3 X-Sequence-Number: 9822 olivier dorie wrote: > Hello, > > > I have some problems to have a transaction isolation level serializable > with postgresql-ODBC driver for windows by using the ODBC cursor > (UseDeclareFetch=1). > > > My database is on PostgreSQL 8.3.7/ Linux. > > I use the postgresql-ODBC version 8.03.04 for windows. > > I make this test with the default_transaction_isolation = 'read > committed' and after with the default_transaction_isolation = > 'serializable' on the server. The results are the same. > > > I do the followings operations in a c++ programm: > > * I open 2 connections on my database with the ODBC drivers: > “connexion1” and “connexion2” > o /CDatabase * db1 = new CDatabase ;/// > o /CDatabase * db2 = new CDatabase/// > o /db1->OpenEx (chaine_connection_mydatabase, > CDatabase::noOdbcDialog);/// > o /db2->OpenEx (chaine_connection_mydatabase, > CDatabase::noOdbcDialog)/// > * I ask for the number of tuples of table “table1” ŕ n tuples: > o /CRecordset crs (//db1)/ > o /crs.Open (CRecordset::snapshot, "SELECT count (*) FROM > table1;")/// > * I make the “connexion1” serializable : > o /db1->ExecuteSQL (“BEGIN TRANSACTION;”) / > o /db1->ExecuteSQL (“SET TRANSACTION ISOLATION LEVEL > SERIALIZABLE;”)/ ODBC doesn't recommend to call dbms specific commands to control transaction. Please use BeginTrans/CommitTrans/Rollback instead. Anyway I improved the handling of transaction under useDeclareFetch mode a little. Please try the drivers on testing for 8.4.0100 at http://www.geocities.jp/inocchichichi/psqlodbc/index.html . regards, Hiroshi Inoue