Skip to main content

java.lang.IllegalStateException

1 reply [Last post]
monyejoe
Offline
Joined: 2013-02-12
Points: 0

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.

AttachmentSize
App.zip34.39 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bobby Bissett

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, 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
>
>
>