openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <>
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 <> 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.

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