I have never seen this problem (I test with Postgres 7.3 running under
cygwin), but I imagine that it is to do with how you have configured
connection pooling. You can set

hibernate.connection.pool_size=0

to disable pooling, if you like, or try out Juozas' suggestion and use a
different pooling implementation.

I do not think this is related to Matt Raible's problem, unless you are
also opening multiple Sessions per transaction (which is a very very bad
antipattern).

Note that you can always bypass Hibernate's Connection and Transaction
handling _altogether_, if you have persistent problems....

  s = sf.openSession( getMyJDBCConnection() );
  // do some work
  s.connection().commit();
  closeMyJDBCConnection( s.close() );

That way you can be CERTAIN that Hibernate is not to blame when you see
these kinds of issues.

> Hi all,
> 
> I have a problem with hibernate and postgresql that I suspect might be
> related to Matt Raible's Oracle problems. Every time hibernate does
> it's stuff to update the database, postgres spawns another "idle in
> transaction" process. Eventually it gives up and the driver throws: -
> 
> Backend start-up failed: FATAL 1:  Sorry, too many clients already
> 
>         at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:306)
>         at org.postgresql.Driver.connect(Driver.java:122)
>         at java.sql.DriverManager.getConnection(DriverManager.java:512)
>         at java.sql.DriverManager.getConnection(DriverManager.java:140)
>         at
cirrus.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:81)



---------------------------------------------------------------------
NEW to mBox, receive faxes to any email address!
Find out more http://www.mbox.com.au/fax


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to