By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Transactions

P: 3
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.
Oct 11 '07 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 700
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
Oct 12 '07 #2

P: 3
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.
Oct 12 '07 #3

Expert 100+
P: 700
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.
Oct 12 '07 #4

P: 3
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='ExclusiveLock' ", it doesn't return any record.

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

Thank you.
Oct 12 '07 #5

Expert 100+
P: 700
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='ExclusiveLock' ", it doesn't return any record.

I've also tried with 'ExclusiveRowLocks' 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.
Oct 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.