Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1RD25x43957 for ; Tue, 27 Feb 2001 08:02:05 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from mail2.rdc1.il.home.com (mail2.rdc1.il.home.com [24.2.1.77]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1QIATx13783 for ; Mon, 26 Feb 2001 13:10:29 -0500 (EST) (envelope-from dhadden2@home.com) Received: from cj517477a ([24.22.132.17]) by mail2.rdc1.il.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20010226181028.MEIF26655.mail2.rdc1.il.home.com@cj517477a> for ; Mon, 26 Feb 2001 10:10:28 -0800 Message-ID: <012c01c0a01f$cc97baa0$11841618@indpdnce1.mo.home.com> From: "Doug Haddan" To: Subject: Disable implicit transactions from ODBC driver on Windows? Date: Mon, 26 Feb 2001 12:13:19 -0600 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0129_01C09FED.81B28600" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200102/182 X-Sequence-Number: 1146 This is a multi-part message in MIME format. ------=_NextPart_000_0129_01C09FED.81B28600 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Two questions really... (1) Is there a way to turn off the implicit BEGIN that PsqlODBC sends to Po= stgreSQL? I want to use multiple SQL statements within transactions explici= tly stated. (2) Is there a way to stop PsqlODBC from sending ABORT when disconnnected a= nd there is no transaction in progress? (Not so critical as first question.) I know that the ODBC driver is sending the BEGIN and ABORT on its own by vi= ewing the psqlodbc_%.log file and observing postmaster response. I am using... + PostgreSQL v7.0.3 (on Linux) + PsqlODBC v6.50 + Microsoft Windows NT SP6a + Microsoft Visual Basic 6 SP4 + Microsoft ADO v3.520.5303.2 Following is a code sample with comments. ------------------------------------------------------------------- Dim cn As ADODB.Connection Set cn =3D New ADODB.Connection With cn .ConnectionString =3D MyConnectionString .Open .BeginTrans '<--- Seems to be ignored by ODBC driver. .CommitTrans '<--- Seems to be ignored by ODBC driver. End With Dim rs As ADODB.Recordset Set rs =3D New ADODB.Recordset With rs .ActiveConnection =3D cn .Source =3D "BEGIN WORK;" .Open=20 '-- At this point, the ODBC driver sends "BEGIN" and "BEGIN WORK;" '-- to PostgreSQL and the postmaster complains by displaying the '-- message "BEGIN: already a transaction in progress. .Source =3D "COMMIT WORK;" .Open '<--- Seems to work OK. End With cn.Close Set rs =3D Nothing Set cn =3D Nothing End '-- The ODBC driver sends "ABORT" to PostgreSQL. The postmaster '-- displays "ROLLBACK: no transaction in progress" and displays the '-- message "pg_recvbuf: unexpected EOF on client connection". ------------------------------------------------------------------- Any help would be appreciated. Thanks! Doug ------=_NextPart_000_0129_01C09FED.81B28600 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Two questions really...
 
(1) Is there a way to turn off the implicit BEGIN that PsqlODBC s= ends=20 to PostgreSQL? I want to use multiple SQL statements within transactio= ns=20 explicitly stated.
 
(2) Is there a way to stop PsqlODBC from sending ABORT when disconnnec= ted=20 and there is no transaction in progress? (Not so critical as first=20 question.)
 
I know that the ODBC driver is sending the BEGIN and ABORT on its own = by=20 viewing the psqlodbc_%.log file and observing postmaster response.
 
I am using...
+ PostgreSQL v7.0.3 (on Linux)
+ PsqlODBC v6.50
+ Microsoft Windows NT SP6a
+ Microsoft Visual Basic 6 SP4
+ Microsoft ADO v3.520.5303.2

Following is a code sample with comments.
 
-------------------------------------------------------------------Dim=20 cn As ADODB.Connection
Set cn =3D New ADODB.Connection
With=20 cn
    .ConnectionString =3D MyConnectionString
    .Open
    .BeginTrans  '<= ---=20 Seems to be ignored by ODBC driver.
    .CommitTrans = ;=20 '<--- Seems to be ignored by ODBC driver.
End With
Dim rs As ADODB.Recordset
Set rs =3D New=20 ADODB.Recordset
With rs
    .ActiveConnection =3D=20 cn
    .Source =3D "BEGIN WORK;"
   =20 .Open 
'-- At this point, the ODBC driver sends "BEGIN" and "BEGIN=20 WORK;"
'-- to PostgreSQL and the postmaster complains by displaying the
'-- message "BEGIN: already a transaction in progress.
    .Source =3D "COMMIT WORK;"
    .Open  '<--- Seems to work OK.
End=20 With
cn.Close
Set rs =3D Nothing
Set cn =3D Nothing
End
'-- The ODBC driver sends "ABORT" to PostgreSQL. The postmaster
'-- displays "ROLLBACK: no transaction in progress" and displays the
'-- message "pg_recvbuf: unexpected EOF on client connection".
-------------------------------------------------------------------
 
Any help would be appreciated.
 
Thanks!
Doug
------=_NextPart_000_0129_01C09FED.81B28600--