Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 27130 invoked from network); 20 Aug 2007 00:51:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2007 00:51:46 -0000 Received: (qmail 33653 invoked by uid 500); 20 Aug 2007 00:51:43 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 33621 invoked by uid 500); 20 Aug 2007 00:51:43 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 33612 invoked by uid 99); 20 Aug 2007 00:51:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Aug 2007 17:51:43 -0700 X-ASF-Spam-Status: No, hits=-2.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Aditi.Das@schwab.com designates 162.93.195.149 as permitted sender) Received: from [162.93.195.149] (HELO bb0eb005.schwab.com) (162.93.195.149) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 00:52:09 +0000 Received: from nap0445bdc.us.global.schwab.com (nap0445bdc.nt.schwab.com [10.104.60.46]) by bb0eb005.schwab.com (Switch-3.2.4/Switch-3.2.4) with SMTP id l7K0pHS2005468 for ; Sun, 19 Aug 2007 20:51:17 -0400 Received: from s0743cdc.cdc.schwab.com (s0743cdc.cdc.schwab.com [162.93.239.70]) by bb0eb005.schwab.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id l7K0pHk5005465 for ; Sun, 19 Aug 2007 20:51:17 -0400 Received: ( Schwab Email ) by sendmail.cf s0743cdc with ESMTP id l7K0pEQo018844 for ; Sun, 19 Aug 2007 20:51:15 -0400 Received: from nex2004cdc.us.global.schwab.com ([10.100.8.27]) by nex1121sfo.us.global.schwab.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 19 Aug 2007 17:51:14 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7E2C4.35272092" Subject: Does embedded class works only with enhancer? Date: Sun, 19 Aug 2007 17:51:12 -0700 Message-ID: <051B157340C53E46B6DF13FD67B533FD03EFB465@nex2004cdc.us.global.schwab.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Does embedded class works only with enhancer? thread-index: AcfixDSTZmR+3rRfQ7CQx76MwQDEvg== From: "Das, Aditi" To: X-OriginalArrivalTime: 20 Aug 2007 00:51:14.0276 (UTC) FILETIME=[35858A40:01C7E2C4] X-CFilter-Loop: Reflected X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7E2C4.35272092 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 I have a entity and a emdeddable class as below. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @Entity(name =3D "ARTICLE") public class Article implements Cloneable,Serializable{ @Id @GeneratedValue(strategy=3DGenerationType.AUTO) private long id; =20 @Embedded private Content content; =20 @Version @Column(name =3D "VER") private long version; } =20 @Embeddable public class Content { @Lob private String content; =20 public String getContent() { return content; } =20 public void setContent(String content) { this.content =3D content; } } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =20 When I run the below code with enhancer, everything works fine, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D tx.begin(); Article article =3D em.find(Article.class,11); article.getContent().setContent("Once upon a time there is a city of Hamelin!!!"); tx.commit(); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 But without enhancer, it gives me the below error. =20 ------------------------------------------------------------------------ ---------------------------------------------------------- Exception in thread "main" org.apache.openjpa.persistence.RollbackException: no-saved-fields at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImp l.java:420) at jpa.ArticleTest.main(ArticleTest.java:24) Caused by: org.apache.openjpa.persistence.PersistenceException: no-saved-fields at org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.j ava:799) at org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl. java:4649) at org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$0(BrokerImpl.ja va:4644) at org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl. java:3767) at org.apache.openjpa.kernel.BrokerImpl.setDirty(BrokerImpl.java:3884) at org.apache.openjpa.kernel.StateManagerImpl.setPCState(StateManagerImpl.j ava:207) at org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1 533) at org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1 472) at org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.j ava:809) at org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl. java:4649) at org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$0(BrokerImpl.ja va:4644) at org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl. java:3767) at org.apache.openjpa.kernel.BrokerImpl.getTransactionalStates(BrokerImpl.j ava:3756) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1898) at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1879) at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:17 97) at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime .java:81) at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1327) at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java: 866) at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImp l.java:409) ... 1 more ------------------------------------------------------------------------ ----------------------------------------------------------------- =20 When I traced back, I found the below code in BrokerImpl(kernel package) where the embadable stateManager is getting added to the _untracked. =20 public void add(StateManagerImpl sm) { if (!sm.isIntercepting()){ if (_untracked =3D=3D null) _untracked =3D new HashSet(); _untracked.add(sm); } .................... } =20 If I change the above code to , everything works fine.. =20 public void add(StateManagerImpl sm) { if (!sm.isIntercepting() && !sm.isEmbedded()) { if (_untracked =3D=3D null) _untracked =3D new HashSet(); _untracked.add(sm); } .................... } =20 =20 Not sure whether it is a feature of enhancer or a bug..Or am I missing out any annotation/property etc.? =20 =20 Please let me know, Aditi =20 =20 ------_=_NextPart_001_01C7E2C4.35272092--