Transactions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ElProta
    New Member
    • Oct 2007
    • 3

    Transactions

    Hi people. I'm connecting to a PostreSql database trough ADO. Sometimes I issue the command to begin a transaction, and it works perfectly. But, i want to rollback a transaction, looking for it in a table.

    For example, in SQL Server i used to issue "select @@trancount", but how can i get all active transactions in Postgres.

    Thanks.
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Originally posted by ElProta
    Hi people. I'm connecting to a PostreSql database trough ADO. Sometimes I issue the command to begin a transaction, and it works perfectly. But, i want to rollback a transaction, looking for it in a table.

    For example, in SQL Server i used to issue "select @@trancount", but how can i get all active transactions in Postgres.

    Thanks.
    You can use pg_locks table

    Comment

    • ElProta
      New Member
      • Oct 2007
      • 3

      #3
      Originally posted by rski
      You can use pg_locks table
      But, does anyone know the command i have to issue to get uncommited transactions ?

      That's what i wanna know.

      Thank you so much.

      Comment

      • rski
        Recognized Expert Contributor
        • Dec 2006
        • 700

        #4
        Originally posted by ElProta
        But, does anyone know the command i have to issue to get uncommited transactions ?

        That's what i wanna know.

        Thank you so much.
        I don't know why can't you use pg_locks table. All uncommited are here.

        Comment

        • ElProta
          New Member
          • Oct 2007
          • 3

          #5
          Originally posted by rski
          I don't know why can't you use pg_locks table. All uncommited are here.
          Ok, the matter is i'm using ADO Connection to acces my database. The ADO Object has several methods, like BeginTrans, RollBackTrans, CommitTrans, etc.

          When I issue "select count(*)as conteo from pg_locks where mode='Exclusive Lock' ", it doesn't return any record.

          I've also tried with 'ExclusiveRowLo cks' and it doesn't work.

          Thank you.

          Comment

          • rski
            Recognized Expert Contributor
            • Dec 2006
            • 700

            #6
            Originally posted by ElProta
            Ok, the matter is i'm using ADO Connection to acces my database. The ADO Object has several methods, like BeginTrans, RollBackTrans, CommitTrans, etc.

            When I issue "select count(*)as conteo from pg_locks where mode='Exclusive Lock' ", it doesn't return any record.

            I've also tried with 'ExclusiveRowLo cks' and it doesn't work.

            Thank you.
            I don't kmow the AOD Connection but if it starts a transaction it must be in pg_locks table. Just begin a transaction form a command line and check a pg_locks.

            Comment

            Working...