persistence@glassfish.java.net

Re: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST.

From: Jon Miller <jemiller_at_uchicago.edu>
Date: Fri, 12 Jan 2007 13:25:30 -0600

I have it working now. I noticed that there was a separate persistence
download and I'm using that.

Jon

----- Original Message -----
From: "Jon Miller" <jemiller_at_uchicago.edu>
To: <persistence_at_glassfish.dev.java.net>
Sent: Friday, January 12, 2007 1:13 PM
Subject: Re: java.lang.IllegalStateException: During synchronization a new
object was found through a relationship that was not marked cascade PERSIST.


> OK, I downloaded the binary for B31 which came out on the 11th. The
> problem now is that the jar file is a toplink-essentials.jar.pack.gz. I
> gunziped it, but, I don't know what to do with it after that. Is it really
> necessary to compress a file that is already compressed? Seems a bit
> excessive.
>
> Jon
>
> ----- Original Message -----
> From: "Mitesh Meswani" <Mitesh.Meswani_at_Sun.COM>
> To: <persistence_at_glassfish.dev.java.net>
> Sent: Thursday, January 11, 2007 12:53 PM
> Subject: Re: java.lang.IllegalStateException: During synchronization a new
> object was found through a relationship that was not marked cascade
> PERSIST.
>
>
>> Hi Jon,
>>
>> The fix should be in yesterday's nightly build of glassfish. Please
>> extract toplink-essentials.jar from it (the standalone persistence bundle
>> is only available for promoted builds).
>>
>> It should be very easy to build from sources also. Following summarizes
>> steps needed to just build entity-persistence module
>>
>> mkdir workspace
>> % cd workspace
>> % cvs -d :pserver:<userid>@cvs.dev.java.net:/cvs checkout
>> glassfish/bootstrap
>>
>>
>> #
>> #Configure Build Variables as described in the build quick start guide
>> step 2
>> # before proceeding further
>> #
>>
>> cd glassfish/bootstrap
>> #checkout sources
>> maven -Dmodules=entity-persistence checkout
>> #bootstrap glassfish environment
>> maven bootstrap
>> #build entity-persistence
>> maven -Dmodules=entity-persistence build
>> Regards,
>> Mitesh
>>
>>
>> Jon Miller wrote:
>> Mitesh,
>>
>> Thanks for the super fast enhancement on this. Much appreciated. Are
>> there nightly binary builds, or, do you have to build it from the source?
>> If the later, I'm wondering which projects I need to check out. I tried
>> building from the source once before, but, from what I remember, I needed
>> something more than just the persistence project.
>>
>> Jon
>>
>> ----- Original Message ----- From: "Mitesh Meswani"
>> <Mitesh.Meswani_at_Sun.COM>
>> To: <persistence_at_glassfish.dev.java.net>
>> Sent: Wednesday, January 10, 2007 8:02 PM
>> Subject: Re: java.lang.IllegalStateException: During synchronization a
>> new object was found through a relationship that was not marked cascade
>> PERSIST.
>>
>>
>>
>> Hi Jon,
>>
>> A fix has been checked in
>> <https://glassfish.dev.java.net/source/browse/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/localization/i18n/ExceptionLocalizationResource.java?r1=1.14&r2=1.15>.
>> The error message now includes the offending object. Today's nightly
>> should contain the fix. Typically you get into this situation if you are
>> not maintaining both sides of your relationships. For example if you have
>> a domain model with Department and Employee with a bidirectional
>> relationship, if you do emp.setDepartment(newDepartment), you will need
>> to make sure to remove the employee from its old department's employees
>> collection and add it to newDeapartment's employee collection.
>>
>> -Mitesh
>>
>>
>> Jon Miller wrote:
>>
>> Hi all,
>>
>> I'm running into the following exception. I'm wondering if anyone
>> has suggestions on how to find the offending object? I'm thinking it
>> might be nice if the error message did something like print the
>> toString() representation of the offending object.
>>
>> Caused by: javax.faces.el.EvaluationException:
>> javax.persistence.RollbackException: java.lang.IllegalStateException:
>> During synchronization a new object was found through a relationship that
>> was not marked cascade PERSIST.
>>
>> Jon
>>
>>
>>
>