openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <daryl.stu...@opentempo.com>
Subject Re: Get the persistencUnit using EntittyManager Taking 4 seconds
Date Tue, 11 May 2010 14:10:30 GMT
On Tue, May 11, 2010 at 9:12 AM, C N Davies <cnd@cndavies.com> wrote:

> This is one of the significant limitations with JPA, not just OpenJPA, each
> time you create an entity manager it reads all the DB meta before you can
> do
> anything.


Hmm, I'm not sure I buy that. The OP's code does not clearly indicate where
the 4 seconds of processing is occurring. I can see the EMF taking 4 seconds
to instantiate.


> The only solution I have found is to keep an EM hanging around as
> long as possible and reuse it,


I create and throw away an EM with each HTTP request. I don't have any
performance problems with this.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
http://www.opentempo.com
mailto:daryl.stultz@opentempo.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message