Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 40583 invoked from network); 9 Dec 2006 17:24:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2006 17:24:05 -0000 Received: (qmail 33009 invoked by uid 500); 9 Dec 2006 17:24:13 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 32910 invoked by uid 500); 9 Dec 2006 17:24:12 -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 32901 invoked by uid 99); 9 Dec 2006 17:24:12 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2006 09:24:12 -0800 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 [199.237.51.194] (HELO green.rootmode.com) (199.237.51.194) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2006 09:23:59 -0800 Received: from [192.168.15.15] (cpe-76-167-174-30.socal.res.rr.com [76.167.174.30]) by green.rootmode.com (8.12.11.20060308/8.12.10) with ESMTP id kB9HNXSZ025552 for ; Sat, 9 Dec 2006 12:23:34 -0500 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <7769269.post@talk.nabble.com> References: <7769269.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <9A2458D0-7927-49FF-A472-63FC4B30DEAC@iq80.com> Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: extending the life of a LRS query Date: Sat, 9 Dec 2006 09:23:31 -0800 To: open-jpa-dev@incubator.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org I am by no means an OpenJPA expert, but I did see something related to this when reading the docs yesterday. OpenJPA has a QueryResultsCache where it keeps the results of a query so if you run the query again you get the same results (I'm not sure if that is what you want). Here is the code from the docs: OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf); QueryResultCache qcache = oemf.getQueryResultCache(); EntityManager em = emf.createEntityManager(); Query pinQuery = em.createQuery(...). setParameter(0, paramVal0). setParameter(1, paramVal1); qcache.pin(pinQuery); Query unpinQuery = em.createQuery(...). setParameter(0, paramVal0). setParameter(1, paramVal1); qcache.unpin(unpinQuery); Hope that helped. -dain On Dec 8, 2006, at 8:04 PM, roger.keays wrote: > > Hi, > > I'm trying to use OpenJPA's fetch plan extensions to have a query > return a > large result set. It seems to work okay, except that the LRS gets > closed / > detached with the EntityManager, which only makes it useful for one > request. > Is it possible to have the LRS stay open after the em has been > disposed? > > Thanks, > > Roger > -- > View this message in context: http://www.nabble.com/extending-the- > life-of-a-LRS-query-tf2784490.html#a7769269 > Sent from the open-jpa-dev mailing list archive at Nabble.com.