users@glassfish.java.net

Re: java.lang.IllegalStateException

From: Bobby Bissett <bbissett_at_gmail.com>
Date: Thu, 14 Feb 2013 11:38:20 -0500

I've tried responding to this twice on the forums but it's not showing
up. In case replying here helps....

--- begin ---
The error message means what it says, but makes a lot more sense once
you've found the code problem. You're trying to persist some class A
that has a relationship with B (e.g., A has getB() and setB()
methods). But B hasn't been persisted.

If you google "During synchronization a new object was found through a
relationship that was not marked cascade PERSIST" you'll see a lot of
answers, examples, etc.

I think you can either persist B first or mark the relationship in A
to cascade the persist call.

Cheers,
Bobby
--- end ---


On Tue, Feb 12, 2013 at 10:35 AM, <forums_at_java.net> wrote:
> I am having an error in my project. Please, could anybody help me with the
> solution? I really need to get it resolved to be able to carry on. Below is
> the error and also attached is my application and database dump: Caused by:
> java.lang.IllegalStateException: During synchronization a new object was
> found through a relationship that was not marked cascade PERSIST:
> com.line.ent.Project[ idproject=2 ] Thanks in anticipation. Joe Monye.
>
> --
>
> [Message sent by forum member 'monyejoe']
>
> View Post: http://forums.java.net/node/894658
>
>
>