openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Giblin <>
Subject Re: relationship EntityManager and JDBC Connection?
Date Sun, 27 Sep 2009 21:51:17 GMT
... more to the background of my problem :

I create an EM instance and loop, calling persist() on perhaps > 2,000
objects in batches of 50.
I run netstat -an | grep 1527 and observe thousands of TCP sessions being
open and closed.  Eventually, there are almost 4,000 TCP sockets in
TIME_WAIT state.

Eventually " Address already in use: connect " is
thrown which, from what  read, is an OS limit on TCP connections being

Is there a way I can control the use of db connections and TCP sockets? Is
the only way out a connection pool?


> Does an EntityManager instance correspond one-to-one to a JDBC
> When the EM is closed, is the JDBC connection closed? That is, by opening
> and closing EMs, is one also opening and closing JDBC connections?
> I am using OpenJPA with Derby. There is no connection pooling:
>  <property name="openjpa.ConnectionDriverName" value=
> "org.apache.derby.jdbc.ClientDriver"/>
> Sorry if I overlooked in the excellent documentation.

View raw message