users@glassfish.java.net

Re: Relationship NOT marked cascade PERSIST

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Thu, 14 Feb 2008 15:24:35 -0800

You typically run into this issue when you do not manage both sides of
your relationships. For example, if you have a bidirectional Employee -
Department relationship. If you do e1.setDepartment(d1) please make sure
to do d1.getEmployees().add(e1)

-Mitesh

glassfish_at_javadesktop.org wrote:
> I have spent most of the day combing through the entity beans I created ensuring I have the relationships identified correctly. I have ran the annotations through the Sun App Server verifier utility. The applicat also deploys to Glassfish, however, when I run the application, it is throwing an error
>
> java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.cm.ejb.bean.entity.ItemPart_at_1f40964.
> at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork$1.iterate(RepeatableWriteUnitOfWork.java:140)
>
> I have tried to trim back the relations where possible so it would be easy to follow. Any suggestions would be greated appreciated.
>
> Russ
> [Message sent by forum member 'russ205' (russ205)]
>
> http://forums.java.net/jive/thread.jspa?messageID=259085
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>