Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 26885 invoked from network); 11 May 2010 14:10:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 May 2010 14:10:59 -0000 Received: (qmail 21272 invoked by uid 500); 11 May 2010 14:10:59 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 21248 invoked by uid 500); 11 May 2010 14:10:59 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 21240 invoked by uid 99); 11 May 2010 14:10:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 14:10:58 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.2.163] (HELO exprod7og105.obsmtp.com) (64.18.2.163) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 11 May 2010 14:10:52 +0000 Received: from source ([209.85.211.200]) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKS+llVySYA+/G6MYNmpcgnDH9nUXAnb3M@postini.com; Tue, 11 May 2010 07:10:32 PDT Received: by ywh38 with SMTP id 38so4303976ywh.29 for ; Tue, 11 May 2010 07:10:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.221.84 with SMTP id ib20mr4473982qcb.93.1273587030563; Tue, 11 May 2010 07:10:30 -0700 (PDT) Received: by 10.229.23.132 with HTTP; Tue, 11 May 2010 07:10:30 -0700 (PDT) In-Reply-To: <00ad01caf10b$96c493c0$c44dbb40$@com> References: <1273582364156-5035800.post@n2.nabble.com> <00ad01caf10b$96c493c0$c44dbb40$@com> Date: Tue, 11 May 2010 10:10:30 -0400 Message-ID: Subject: Re: Get the persistencUnit using EntittyManager Taking 4 seconds From: Daryl Stultz To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=00163630f0738c1b1004865216fd --00163630f0738c1b1004865216fd Content-Type: text/plain; charset=ISO-8859-1 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. http://www.6degrees.com http://www.opentempo.com mailto:daryl.stultz@opentempo.com --00163630f0738c1b1004865216fd--