pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Turn off implicit BEGIN from ODBC driver on Windows?
7+ messages / 4 participants
[nested] [flat]

* Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-14 22:27  Doug Haddan <dhadden2@home.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Doug Haddan @ 2001-01-14 22:27 UTC (permalink / raw)
  To: pgsql-interfaces

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.

(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

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-16 13:48  Adam Lang <aalang@rutgersinsurance.com>
  parent: Doug Haddan <dhadden2@home.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Adam Lang @ 2001-01-16 13:48 UTC (permalink / raw)
  To: pgsql-interfaces

Did you try putting a couple SQL statements between the BeginTrans and
CommitTrans and see what happened?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Doug Haddan" <dhadden2@home.com>
To: <pgsql-interfaces@postgresql.org>
Sent: Sunday, January 14, 2001 5:27 PM
Subject: [INTERFACES] Turn off implicit BEGIN from ODBC driver on Windows?


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.

(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





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-16 15:17  kovacsz <zoli@pc10.radnoti-szeged.sulinet.hu>
  parent: Adam Lang <aalang@rutgersinsurance.com>
  0 siblings, 2 replies; 7+ messages in thread

From: kovacsz @ 2001-01-16 15:17 UTC (permalink / raw)
  To: Adam Lang <aalang@rutgersinsurance.com>; +Cc: pgsql-interfaces

> Did you try putting a couple SQL statements between the BeginTrans and
> CommitTrans and see what happened?
> 
> [...]
> 
> I am using...
> + PostgreSQL v7.0.3 (on Linux)
> + PsqlODBC v6.50
AFAIK the newest driver (see 7.1 source) will support your needs. You can
download a binary version from my ftp site
(ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/WinODBC)
which may be enough for you, but there are newer ones as well. Note that
v6.50 is NOT the newest version, in fact it's rather old.

Zoltan

(Please reply to tip@pc10.radnoti-szeged.sulinet.hu.)




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-16 15:25  Adam Lang <aalang@rutgersinsurance.com>
  parent: kovacsz <zoli@pc10.radnoti-szeged.sulinet.hu>
  1 sibling, 1 reply; 7+ messages in thread

From: Adam Lang @ 2001-01-16 15:25 UTC (permalink / raw)
  To: ; +Cc: pgsql-interfaces

This is the official driver?  Is there an installer? or do we need to
register the driver ourselves?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "kovacsz" <zoli@pc10.radnoti-szeged.sulinet.hu>
To: "Adam Lang" <aalang@rutgersinsurance.com>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Tuesday, January 16, 2001 10:17 AM
Subject: Re: [INTERFACES] Turn off implicit BEGIN from ODBC driver on
Windows?


> > Did you try putting a couple SQL statements between the BeginTrans and
> > CommitTrans and see what happened?
> >
> > [...]
> >
> > I am using...
> > + PostgreSQL v7.0.3 (on Linux)
> > + PsqlODBC v6.50
> AFAIK the newest driver (see 7.1 source) will support your needs. You can
> download a binary version from my ftp site
>
(ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/WinODBC)
> which may be enough for you, but there are newer ones as well. Note that
> v6.50 is NOT the newest version, in fact it's rather old.
>
> Zoltan
>
> (Please reply to tip@pc10.radnoti-szeged.sulinet.hu.)




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-17 10:57  Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
  parent: Adam Lang <aalang@rutgersinsurance.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Kovacs Zoltan Sandor @ 2001-01-17 10:57 UTC (permalink / raw)
  To: Adam Lang <aalang@rutgersinsurance.com>; +Cc: pgsql-interfaces

On Tue, 16 Jan 2001, Adam Lang wrote:

> This is the official driver?  Is there an installer? or do we need to
> register the driver ourselves?
I suggest install an older version, then it's enough to copy the new
PSQLODBC.DLL into the place of the old one.

There is no official binary version at the moment. I think Julia will make
a new one soon.

Zoltan




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-17 18:37  Adam Lang <aalang@rutgersinsurance.com>
  parent: kovacsz <zoli@pc10.radnoti-szeged.sulinet.hu>
  1 sibling, 1 reply; 7+ messages in thread

From: Adam Lang @ 2001-01-17 18:37 UTC (permalink / raw)
  To: ; +Cc: pgsql-interfaces

And this shows up as 6.4, correct?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "kovacsz" <zoli@pc10.radnoti-szeged.sulinet.hu>
To: "Adam Lang" <aalang@rutgersinsurance.com>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Tuesday, January 16, 2001 10:17 AM
Subject: Re: [INTERFACES] Turn off implicit BEGIN from ODBC driver on
Windows?


> > Did you try putting a couple SQL statements between the BeginTrans and
> > CommitTrans and see what happened?
> >
> > [...]
> >
> > I am using...
> > + PostgreSQL v7.0.3 (on Linux)
> > + PsqlODBC v6.50
> AFAIK the newest driver (see 7.1 source) will support your needs. You can
> download a binary version from my ftp site
>
(ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/WinODBC)
> which may be enough for you, but there are newer ones as well. Note that
> v6.50 is NOT the newest version, in fact it's rather old.
>
> Zoltan
>
> (Please reply to tip@pc10.radnoti-szeged.sulinet.hu.)




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Turn off implicit BEGIN from ODBC driver on Windows?
@ 2001-01-18 10:10  Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
  parent: Adam Lang <aalang@rutgersinsurance.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Kovacs Zoltan Sandor @ 2001-01-18 10:10 UTC (permalink / raw)
  To: Adam Lang <aalang@rutgersinsurance.com>; +Cc: pgsql-interfaces



On Wed, 17 Jan 2001, Adam Lang wrote:

> And this shows up as 6.4, correct?
Yes!

> > > Did you try putting a couple SQL statements between the BeginTrans and
> > > CommitTrans and see what happened?
> > >
> > > [...]
> > >
> > > I am using...
> > > + PostgreSQL v7.0.3 (on Linux)
> > > + PsqlODBC v6.50
> > AFAIK the newest driver (see 7.1 source) will support your needs. You can
> > download a binary version from my ftp site
[...]




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2001-01-18 10:10 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-14 22:27 Turn off implicit BEGIN from ODBC driver on Windows? Doug Haddan <dhadden2@home.com>
2001-01-16 13:48 ` Adam Lang <aalang@rutgersinsurance.com>
2001-01-16 15:17   ` kovacsz <zoli@pc10.radnoti-szeged.sulinet.hu>
2001-01-16 15:25     ` Adam Lang <aalang@rutgersinsurance.com>
2001-01-17 10:57       ` Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
2001-01-17 18:37     ` Adam Lang <aalang@rutgersinsurance.com>
2001-01-18 10:10       ` Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>

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