Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Zero not a valid PK value?

Ah, I hadn't thought of the issues that would cause with primitives in
the cache being set to zero. I've marked my bug invalid, Thanks.

./Tim


On Wed, Jul 9, 2008 at 10:45 AM, christopher delahunt
<christopher.delahunt@xxxxxxxxxx> wrote:
> Hello Tim,
>
> I think this problem is related to the fix for bug 233247:
>  https://bugs.eclipse.org/bugs/show_bug.cgi?id=233247
>
> In it, a flag was added to get the previous behavior.  You can add:
>  setIdValidation(IdValidation.NULL);
> to change the behavior on a descriptor by descriptor basis, or use the
> static
>  org.eclipse.persistence.internal.helper.Helper.isZeroValidPrimaryKey =
> true;
> to set it for all descriptors (unless you override it at the descriptor).
>
> Please give this a try.
>
> Chris
>
> Tim Hollosy wrote:
>>
>> I filed a bug about this - #240153 -
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=240153
>>
>> Anyway, this didn't start to happen since M10, but if you have a
>> transaction open and select an Entity with a value of zero as it's PK,
>> you get this when you try to check for changes to the Unit of Work
>> (and probably on a save), I think it's a bit of a show stopper since
>> we can't be the only one with a lone zero value in an id field.
>>
>> Local Exception Stack:
>> Exception [EclipseLink-7197] (Eclipse Persistence Services - 1.0
>> (Build SNAPSHOT - 20080625)):
>> org.eclipse.persistence.exceptions.ValidationException?
>> Exception Description: Null primary key encountered in unit of work
>> clone [com.ussignalcom.plugin.om.model.eo.ServiceBandwidths@1854518].
>>
>>    at
>> org.eclipse.persistence.exceptions.ValidationException?.nullPrimaryKeyInUnitOfWorkClone(ValidationException?.java:1294)
>>    at
>> org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy?.calculateChanges(DeferredChangeDetectionPolicy?.java:84)
>>    at
>> org.eclipse.persistence.internal.sessions.UnitOfWorkImpl?.calculateChanges(UnitOfWorkImpl?.java:558)
>>    at
>> org.eclipse.persistence.internal.sessions.UnitOfWorkImpl?.hasChanges(UnitOfWorkImpl?.java:2553)
>>
>>
>> /Tim
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top