openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Giblin <>
Subject influence connection usage?
Date Tue, 29 Sep 2009 13:08:26 GMT

Is there any way to influence OpenJPA's connection usage when not using
connection pooling?

I plan to move to connection pooling in the future but cannot quite at the
moment. My OpenJPA is configured to use Derby ClientDataSource. When
iterating over objects with lazy-loaded attributes, the query is naturally
issued to fill the proxy as each object is accessed. However,  I never get
through the whole array because eventually the OS has too many TCP
connections (> 2000)  closing (in state TIME_WAIT) and can no load open any
more connections.  It seems each access opens and closes an DB connection
and hence a TCP connection. I get partially around this by changing queries
and using eager loading. But I cannot do this in all cases.

I am wondering, is it possible to get OpenJPA to reuse a connection, rather
than opening and closing so frequently?


View raw message