Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 5110 invoked from network); 25 Apr 2007 17:04:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Apr 2007 17:04:56 -0000 Received: (qmail 55920 invoked by uid 500); 25 Apr 2007 17:05:03 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 55787 invoked by uid 500); 25 Apr 2007 17:05:02 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 55778 invoked by uid 99); 25 Apr 2007 17:05:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 10:05:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.97.132.74] (HELO spaceymail-a2.g.dreamhost.com) (208.97.132.74) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 10:04:54 -0700 Received: from [192.168.15.104] (cpe-76-167-174-30.socal.res.rr.com [76.167.174.30]) by spaceymail-a2.g.dreamhost.com (Postfix) with ESMTP id 7E47D1062FF for ; Wed, 25 Apr 2007 10:04:33 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <7D856CDFE035FF45A0420ACBD71BDD630401B327@repbex02.amer.bea.com> References: <0552F4DC-B386-4968-8F39-C7061EF2D9AF@iq80.com> <18ECF84F-2C22-41F4-8ECD-CFA9C3B636FA@apache.org> <41603240-33BC-4B51-91AA-ABDADE6BF80A@iq80.com> <7D856CDFE035FF45A0420ACBD71BDD630401B2F1@repbex02.amer.bea.com> <9E5C8D48-C713-4BFF-8955-456D36F784F1@iq80.com> <7D856CDFE035FF45A0420ACBD71BDD630401B327@repbex02.amer.bea.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1CFB8213-FCAA-482D-A510-8441FD851858@iq80.com> Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: Set query params without TX? Date: Wed, 25 Apr 2007 10:04:25 -0700 To: open-jpa-dev@incubator.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org On Apr 24, 2007, at 10:35 PM, Patrick Linskey wrote: > Yep -- you've gotta keep it open. If you want to support any JPA impl, > you need to have an EM proxy (please please please make it a dynamic > proxy that implements all the interfaces that the proxied thing > implements). That code is from my proxy. > If you're happy tying yourself to OpenJPA (or if you want to optimize > for OpenJPA), then you can use the openjpa.AutoDetach property to tell > OpenJPA how to handle non-transactional work. In that scenario, you > can > keep a single EM per your delegating instance, and rely on OpenJPA > to do > the transactional PC semantics. I just might give that a try. If I want to have generic code, how am I supposed to implement the createNamedQuery method? Do I leave the EM open forever? That doesn't seem right. So when am I supposed to close the EM? -dain