openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Giblin <...@zurich.ibm.com>
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 "java.net.BindException: Address already in use: connect " is
thrown which, from what  read, is an OS limit on TCP connections being
exhausted.

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

Thanks,chris



> Does an EntityManager instance correspond one-to-one to a JDBC
connection?
> 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.


Mime
View raw message