Return-Path: Delivered-To: apmail-openejb-users-archive@www.apache.org Received: (qmail 5517 invoked from network); 17 Feb 2011 07:16:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 07:16:10 -0000 Received: (qmail 21277 invoked by uid 500); 17 Feb 2011 07:16:10 -0000 Delivered-To: apmail-openejb-users-archive@openejb.apache.org Received: (qmail 21025 invoked by uid 500); 17 Feb 2011 07:16:07 -0000 Mailing-List: contact users-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openejb.apache.org Delivered-To: mailing list users@openejb.apache.org Delivered-To: moderator for users@openejb.apache.org Received: (qmail 91300 invoked by uid 99); 17 Feb 2011 04:40:29 -0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of chaminda.sl@gmail.com) Date: Wed, 16 Feb 2011 20:40:03 -0800 (PST) From: "chaminda.sl@gmail.com" To: users@openejb.apache.org Message-ID: In-Reply-To: References: <1297885330135-3309594.post@n4.nabble.com> Subject: Re: Remote Interface with JPA Issue MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_24323_3960761.1297917603049" ------=_Part_24323_3960761.1297917603049 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Thiago, Thanks It worked. But this is bit doubtful, the purpose to make entity serializable (if my understanding is correct) is giving chances to change the status of entity in different layers even in different jvm. Thanks again. On Thu, Feb 17, 2011 at 3:06 AM, Thiago Veronezi-3 [via OpenEJB] < ml-node+3309787-2130815877-213545@n4.nabble.com> wrote: > Hi, > > You shouldn't rely on changes on your method=E2=80=99s parameters when wo= rking with > > EJBs. For example, imagine that you are calling=E2=80=A6 > > > > MyEntity myEntity =3D new MyEntity(); > > myEntity.setName(=E2=80=9CThiago=E2=80=9D); > > myEntity.setNickName(=E2=80=9CBoto=E2=80=9D); > > mySessionBean.createEntity(myEntity); > > System.println(myEntity.getId()); > > > > The result of the println method above depends on from where you are > calling > the ejb. If it is a remote ejb, it will be null=E2=80=A6 if it is local, = it will be > > your bean id. That=E2=80=99s because you should return the value from the > =E2=80=9CcreateEntity=E2=80=9D method. So, to fix it, you should change t= he code above > from... > > > mySessionBean.createEntity(myEntity); > > > to=E2=80=A6 > > > myEntity =3D mySessionBean.createEntity(myEntity); > > > Could you check it? > > > []s, > > Thiago. > > On Wed, Feb 16, 2011 at 2:42 PM, [hidden email]< > chaminda.sl@ > gmail.com> wrote: > > > > > > > Hi Guys, > > > > I have a Stateless SB with @Remote interface which calls > > em.persist(entity). > > Entity implements Serialization and Identity as the id generation Type. > > > > Issue is em.persist runs without any exception (in mysql, HSQL and > JavaDB) > > and saves the entity to db but it does not set the generated id to > entity. > > > > Interesting thing is if I change the @Remote to @Local em sets the > > generated > > id to entity fine. > > > > This can be reproduce easily in OpenEJB example as well... > > > > Thanks > > -- > > View this message in context: > > > http://openejb.979440.n4.nabble.com/Remote-Interface-with-JPA-Issue-tp330= 9594p3309594.html > > Sent from the OpenEJB User mailing list archive at Nabble.com. > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://openejb.979440.n4.nabble.com/Remote-Interface-with-JPA-Issue-tp330= 9594p3309787.html > To unsubscribe from Remote Interface with JPA Issue, click here. > > --=20 Chaminda Amarasinghe, --=20 View this message in context: http://openejb.979440.n4.nabble.com/Remote-In= terface-with-JPA-Issue-tp3309594p3310187.html Sent from the OpenEJB User mailing list archive at Nabble.com. ------=_Part_24323_3960761.1297917603049--