On Tue, May 11, 2010 at 9:12 AM, C N Davies <[email protected]> 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:[email protected]

Reply via email to