openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <>
Subject RE: relationship EntityManager and JDBC Connection?
Date Mon, 28 Sep 2009 03:04:46 GMT
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:
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 [] 
Sent: Monday, 28 September 2009 1:11 AM
Subject: relationship EntityManager and JDBC Connection?


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=

Sorry if I overlooked in the excellent documentation.


View raw message