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: org.apache.openjpa.jdbc.conf.JDBCConfiguration.getDriverDataSource Resource adaptor config-property: DriverDataSource Default: pooling" "In its default configuration, OpenJPA obtains JDBC connections on an as-needed basis. OpenJPA EntityManagers do not retain a connection to the database unless they are in a datastore transaction or there are open Query results that are using a live JDBC result set. At all other times, including during optimistic transactions, EntityManagers request a connection for each query, then immediately release the connection back to the pool." -----Original Message----- From: Christopher Giblin [mailto:[email protected]] Sent: Monday, 28 September 2009 1:11 AM To: [email protected] Subject: relationship EntityManager and JDBC Connection? 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 name="openjpa.ConnectionDriverName" value= "org.apache.derby.jdbc.ClientDriver"/> Sorry if I overlooked in the excellent documentation. Thanks,chris
