If I query:
select * from pg_stat_activity where application_name ~ 'example-application';
I get many rows which state is idle
and query is COMMIT
. They are long lasting and do not disappear. After some time, my application reach hibernate.c3p0.max_size
(maximum number of JDBC connections in the pool) limit and stops working with database.
Some application implementation details are described in other SO thread: Guice DAO Provider in thread pool - queries become 'idle in transation'
Why does it happen? How to solve this problem?