Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 7677 invoked from network); 11 Sep 2007 10:01:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2007 10:01:03 -0000 Received: (qmail 93166 invoked by uid 500); 11 Sep 2007 10:00:57 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 93088 invoked by uid 500); 11 Sep 2007 10:00:57 -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 93078 invoked by uid 99); 11 Sep 2007 10:00:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2007 03:00:57 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eshepelyuk@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2007 10:00:54 +0000 Received: by nf-out-0910.google.com with SMTP id k4so1140391nfd for ; Tue, 11 Sep 2007 03:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:to:subject:from:organization:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; bh=SSNNzeZ+msrRXdjCuCPxhAIyTlGwsgpi3/XfeYgmUQM=; b=KrclSsgUQERaKPD9/kEtPZ41yQfTSVxFqvLjanHbmO2KBtrJlZGiFWRZfeUHyzA+dq0yJ7MXc2LLKZEryozWAhBHaPi67M218i1agp4A15BhwGBdDqHOXvw+smqKlIKxGI9er1LhyxagKFusqkp4AwGg84hw0fvLYGKLIspwonU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:from:organization:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=Ik/eQ+hJdpEn+Q/goyM+s7EDDVA456SPqRzTBGCPGgDjSMTVJeqBS9ONviCfNIio2GXM1LIwPwOuPVwk5gb/ijtpIZ+aUvIJpcIqHe6gTjkYSonYpALkpeh1fHIOxl856Ygj267T+ohFKUUdtmLf51f3WsXoyvfZ/g3drRsEdnA= Received: by 10.78.107.8 with SMTP id f8mr2430009huc.1189504833207; Tue, 11 Sep 2007 03:00:33 -0700 (PDT) Received: from osiris.si ( [195.189.200.2]) by mx.google.com with ESMTPS id 30sm4230755hue.2007.09.11.03.00.29 (version=SSLv3 cipher=OTHER); Tue, 11 Sep 2007 03:00:30 -0700 (PDT) Date: Tue, 11 Sep 2007 12:59:25 +0300 To: users@openjpa.apache.org Subject: Re: Lazy load for detached entities From: "Evgeny Shepelyuk" Organization: SI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.23 (Win32) X-Virus-Checked: Checked by ClamAV on apache.org 11.09.07 в 12:17 Gene Wu в своём письме писал(а): > to support lazy load base on your code. Just change the order. Load the > object before you close em(this is the context needed for lazy load). > > EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1"); > EntityManager em = emf.createEntityManager(); > OrdersEntity order = em.find(OrdersEntity.class, .....); > System.out.println(order.getUser()); > em.close(); > emf.close(); > > Thanks, > > Gene. Thnx but this answer is _completely_ useless. I know that changing the order will fix that code. But my code are few times more complicated and requires passing of detached entities. So i do need some solution for this except EAGER fetch. -- Best Regards Evgeny K. Shepelyuk