-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: idle in transaction
PostPosted: Sun Mar 08, 2009 7:51 am 
Newbie

Joined: Sun Mar 08, 2009 7:48 am
Posts: 1
Hi guys,

postgresql-8.2-505.jdbc3.jar
hibernate3.jar


I'm getting this form ps aux:
Code:
postgres 18490 S Mar07   0:00 postgres: 127.0.0.1(52783) idle in transaction
postgres 30755 S Mar07   0:00 postgres: 127.0.0.1(48223) idle in transaction
postgres   666 S Mar07   0:01 postgres: 127.0.0.1(38756) idle in transaction
postgres 14576 S Mar07   0:00 postgres: 127.0.0.1(55468) idle in transaction
postgres 23865 S 01:48   0:00 postgres: 127.0.0.1(55478) idle in transaction
Now, after extensive searching I found these helpfull queries and ran them all and got nothing :(

Code:
select pg_stat_activity.datname,pg_class.relname,pg_locks.transaction, pg_locks.mode, pg_locks.granted,pg_stat_activity.usename,substr(pg_stat_activity.current_query,1,30), pg_stat_activity.query_start, age(now(),pg_stat_activity.query_start) as "age", pg_stat_activity.procpid from pg_stat_activity,pg_locks left outer join pg_class on (pg_locks.relation = pg_class.oid)  where pg_locks.pid=pg_stat_activity.procpid order by query_start;

  datname  |     relname      | transaction |      mode       | granted |  usename  | substr |         query_start          |       age       | procpid
-----------+------------------+-------------+-----------------+---------+-----------+--------+------------------------------+-----------------+---------
preferans | pg_stat_activity |    87688518 | AccessShareLock | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793
preferans | pg_database      |    87688518 | AccessShareLock | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793
preferans |                  |    87688518 | ExclusiveLock   | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793
preferans | pg_locks         |    87688518 | AccessShareLock | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793
preferans | pg_authid        |    87688518 | AccessShareLock | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793
preferans | pg_class         |    87688518 | AccessShareLock | t       | preferans | <IDLE> | 2009-03-08 12:48:53.47722+01 | 00:08:35.799393 |    2793


Code:
SELECT pg_class.relname AS table, pg_database.datname AS database, transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database WHERE pg_locks.relation = pg_class.oid AND pg_locks.database = pg_database.oid;

  table   | database  | transaction | pid  |      mode       | granted
----------+-----------+-------------+------+-----------------+---------
pg_class | preferans |    87688589 | 2793 | AccessShareLock | t
pg_locks | preferans |    87688589 | 2793 | AccessShareLock | t


Code:
select pg_class.relname,pg_locks.* from pg_class,pg_locks where pg_class.relfilenode=pg_locks.relation;

relname  | locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction | pid  |      mode       | granted
----------+----------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+------+-----------------+---------
pg_locks | relation |    16385 |    10342 |      |       |               |         |       |          |    87688647 | 2793 | AccessShareLock | t
pg_class | relation |    16385 |     1259 |      |       |               |         |       |          |    87688647 | 2793 | AccessShareLock | t


Code:
SELECT relation, transaction, pid, mode, granted, relname FROM pg_locks INNER JOIN pg_stat_user_tables ON pg_locks.relation = pg_stat_user_tables.relid;

relation | transaction | pid | mode | granted | relname
----------+-------------+-----+------+---------+---------
(0 rows)


Code:
select pg_class.relname, pg_locks.transaction, pg_locks.mode, pg_locks.granted as "g", pg_stat_activity.current_query, pg_stat_activity.query_start, age(now(),pg_stat_activity.query_start) as "age", pg_stat_activity.procpid from pg_stat_activity,pg_locks left outer join pg_class on (pg_locks.relation = pg_class.oid) where pg_locks.pid=pg_stat_activity.procpid order by query_start;

     relname      | transaction |      mode       | g | current_query |          query_start          |       age       | procpid
------------------+-------------+-----------------+---+---------------+-------------------------------+-----------------+---------
pg_stat_activity |    87688780 | AccessShareLock | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
pg_authid        |    87688780 | AccessShareLock | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
pg_class         |    87688780 | AccessShareLock | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
pg_database      |    87688780 | AccessShareLock | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
pg_locks         |    87688780 | AccessShareLock | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
                  |    87688780 | ExclusiveLock   | t | <IDLE>        | 2009-03-08 12:58:39.725985+01 | 00:00:12.221831 |    2793
I used these in the last few days and was able to get some useful info and went into my code and fixed it...but now I get nothing useful :chomp:
Any ideas? Or is this a PostgreSQL issue I'm having?

THANKS!!!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 08, 2009 8:10 am 
Newbie

Joined: Sat Mar 07, 2009 4:24 am
Posts: 10
I don't see the way you are using Hibernate there. Any mapping docs?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.