Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 93694 invoked from network); 9 Apr 2011 23:19:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Apr 2011 23:19:07 -0000 Received: (qmail 83946 invoked by uid 500); 9 Apr 2011 23:19:06 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 83916 invoked by uid 500); 9 Apr 2011 23:19:06 -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 83908 invoked by uid 99); 9 Apr 2011 23:19:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 23:19:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fergusonjason@gmail.com designates 209.85.214.174 as permitted sender) Received: from [209.85.214.174] (HELO mail-iw0-f174.google.com) (209.85.214.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 23:19:00 +0000 Received: by iwn34 with SMTP id 34so6191541iwn.33 for ; Sat, 09 Apr 2011 16:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=BYm1gcvRsiNVCHCVftOoF+AiVhVooa8Jm8NcomxG83A=; b=OurvcELAwzva/MRCY3t5/0L1QiI/srkDdM+u8x6eXSDtEd79CLCpPsFXmR4Y5B3/oG FK0dxHDaBaDJ3+j6a7SaRet67nnaVdSj6PxE4P1xuKEHx7AQtAA3L7XpBsROi7szSCnl tEr8icPOIYgZD4jCm5YtpbIzXn7A6zxTKXn88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=buDk6yq2Ut3GRt7muQ+01mA3TjRICbT0hpeNeF21V3GVnInsDUBOKqmC4E9ubCFBs6 oUfMJyx/swXH2+p1dbaVOQ/AQ8hGUvQHz6GNSwCKTrkYoWWS0vbT/VoxWEBJm/eyv2l5 /4jCc/3dS9lOxiBu94GfrhYhKj/09B7rpY7zE= MIME-Version: 1.0 Received: by 10.43.70.138 with SMTP id yg10mr2317967icb.495.1302391118163; Sat, 09 Apr 2011 16:18:38 -0700 (PDT) Received: by 10.42.197.65 with HTTP; Sat, 9 Apr 2011 16:18:38 -0700 (PDT) In-Reply-To: References: Date: Sat, 9 Apr 2011 18:18:38 -0500 Message-ID: Subject: Re: OpenJPA and GWT Serialization From: Jason Ferguson To: users@openjpa.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I'm running with 2.1.0. I figured if I was going to learn to use JPA versus Hibernate, I may as well use the most current version. So let me see if I'm doing this right. I added the following property to persistence.xml: The docs seem to recommend adding a version field, which I haven't done yet. I also choose "loaded" versus "fetch-group" because I hadn't defined any custom fetch groups. With no offense intended towards the developers, I'm getting the impression that OpenJPA is currently not the right choice for a GWT project, until this particular issue is resolved. Jason On Sat, Apr 9, 2011 at 7:43 AM, Rick Curtis wrote: > Jason - > >> Sorry if this is a frequently asked question. > This isn't a frequent question... yet. It seems that this issue has come up > a number of times on users/dev. There was a recent post[1] on a similar > issue that didn't end with much of a solution. Mike has had this > detach/proxy business on his list of things he wanted to do for quite a > time... :-) > > What version of OpenJPA are you running with? > > If you're running 2.0.0 or later and you're in need of a workaround in the > short term.... and depending on how your application is structured, enabling > LiteAutoDetach[2] might get you by this problem. The only reason I'm > suggesting this property as I know that it will remove all proxies on > EntityManager.close(). > > [1] http://openjpa.markmail.org/thread/sczpivhncne27co4 > [2] > http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_detach_state--- > openjpa.DetachState=loaded(LiteAutoDetach=true) > > Thanks, > Rick > > On Sat, Apr 9, 2011 at 6:55 AM, Jason Ferguson wrote: > >> Sorry if this is a frequently asked question. >> >> I have an entity, Location, which has a bidirectional >> OneToMany/ManyToOne relationship with another entity, BorderPoint. >> Both entities implement Serializable and IsSerializable. >> >> The BorderPoint collection within the Location object is an ArrayList. >> Unfortunately, OpenJPA uses a proxy class which is not serializable by >> GWT. I've tried annotating both entities with >> @DetachedState(enabled=true) with no luck. >> >> Can anyone assist? >> >> Jason >> >