How to know if a TRANSACTION isn't completed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to know if a TRANSACTION isn't completed

MargaretGillon

I am trying to adapt a class to Postgresql that was written for SQLServer.
As an error check the class counts open transactions to make sure all
previous transactions have been completed.  In SQLServer there is a command
@@TRANCOUNT  which tells how many transactions are open on the server for
the current connection.

Is there  a similar command in Postgresql so that the client application
can find out if there's an unresolved transaction before it starts a new
one?

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
***
Margaret Gillon, IS Dept., Chromalloy Los Angeles, ext. 297


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Reply | Threaded
Open this post in threaded view
|

Re: How to know if a TRANSACTION isn't completed

Neil Conway-2
[hidden email] wrote:
> Is there  a similar command in Postgresql so that the client application
> can find out if there's an unresolved transaction before it starts a new
> one?

See PQtransactionStatus() in libpq; if you're using a different language
interface, it should provide some means to get the same information.

http://developer.postgresql.org/docs/postgres/libpq-status.html

-Neil

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [hidden email] so that your
       message can get through to the mailing list cleanly
Reply | Threaded
Open this post in threaded view
|

Re: How to know if a TRANSACTION isn't completed

MargaretGillon
> [hidden email] wrote:
> > Is there  a similar command in Postgresql so that the client
application
> > can find out if there's an unresolved transaction before it starts a
new
> > one?
>
> See PQtransactionStatus() in libpq; if you're using a different language
> interface, it should provide some means to get the same information.
>
> http://developer.postgresql.org/docs/postgres/libpq-status.html
>
> -Neil

I am using Visual FoxPro with WINDOWS-ODBC to get to a Postgresql 7.3.4
database on a Redhat9 server. Is there an equilavent command I can use with
ODBC?

Margaret


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org