tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Veronezi <>
Subject Re: Remote Interface with JPA Issue
Date Wed, 16 Feb 2011 21:36:02 GMT

You shouldn't rely on changes on your method’s parameters when working with
EJBs. For example, imagine that you are calling…

MyEntity myEntity = new MyEntity();





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… if it is local, it will be
your bean id. That’s because you should return the value from the
“createEntity” method. So, to fix it, you should change the code above



myEntity = mySessionBean.createEntity(myEntity);

Could you check it?



On Wed, Feb 16, 2011 at 2:42 PM, <> 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:
> Sent from the OpenEJB User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message