From: Doug Haddan <dhadden2@home.com>
To: pgsql-interfaces@postgresql.org
Subject: Disable implicit transactions from ODBC driver on Windows?
Date: Mon, 26 Feb 2001 12:13:19 -0600
Message-ID: <012c01c0a01f$cc97baa0$11841618@indpdnce1.mo.home.com> (raw)
Two questions really...
(1) Is there a way to turn off the implicit BEGIN that PsqlODBC sends to PostgreSQL? I want to use multiple SQL statements within transactions explicitly stated.
(2) Is there a way to stop PsqlODBC from sending ABORT when disconnnected and 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 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 cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.ConnectionString = 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 = New ADODB.Recordset
With rs
.ActiveConnection = cn
.Source = "BEGIN WORK;"
.Open
'-- 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 = "COMMIT WORK;"
.Open '<--- Seems to work OK.
End With
cn.Close
Set rs = Nothing
Set cn = 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: dhadden2@home.com
Subject: Re: Disable implicit transactions from ODBC driver on Windows?
In-Reply-To: <012c01c0a01f$cc97baa0$11841618@indpdnce1.mo.home.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox