relationship EntityManager and JDBC Connection?

2009-09-27 Thread Christopher Giblin
Hi, 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

Re: relationship EntityManager and JDBC Connection?

2009-09-27 Thread Christopher Giblin
... 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.

RE: relationship EntityManager and JDBC Connection?

2009-09-27 Thread C N Davies
The doc says: EntityManagerFactory instances are heavyweight objects. Each factory might maintain a metadata cache, object state cache, EntityManager pool, connection pool, and more. 2.6.3. openjpa.jdbc.DriverDataSource Property name: openjpa.jdbc.DriverDataSource Configuration API: