[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Eclipselink-7197 Null primary key
|
That is quite odd. You will need to isolate the specific cases to determine
the cause.
Start with the obvious of ensuring that none of your objects have a null
primary key.
One possibility could be if your using property get/set method access.
Method access can cause corruptions in your object model if the get/set
methods have side-effects. Try switching to field access to see if it
resolves the issue, or search your set methods for side-effects.
Andreas König-2 wrote:
>
> Hey everybody!
>
> I'm quite new to Eclipselink and I have a serious problem here, that I'm
> trying to understand/solve for over a week now:
>
> We have a web application using spring.
>
> I create a new object and save it via jpaTemplate.persist();
> Later I try to load it via jpaTemplate.find().
> That results in an Eclipselink-7197-error:
>
> Exception [EclipseLink-7197] (Eclipse Persistence Services - 1.0.2
> (Build 20081024)):
> org.eclipse.persistence.exceptions.ValidationException Exception
> Description: Null primary key encountered in unit of work clone [null].
>
> I don't understand what is going on here. Debugged it down to
> RepeatableWriteUnitOfWork(UnitOfWorkImpl).commitToDatabaseWithChangeSet:
> 1321
>
> There, the method calculateChanges() is called which throws the exception.
>
> I have no clue what is meant by null primary key, as in the database
> everything seems to be alright. No keys are null, negative or zero.
> Everything is persisted.
>
> Sometimes the same code works in the same scenario. In these cases the
> commitToDB-Code seems not to be executed....
>
> We had the same errors on another part of the system. After setting the
> cachetype of one dependent object to FULL, the problem doesn't occur
> anymore...
>
>
> Anyone got an idea? I'm thankful for everything and any explanation (why
> is there a commit happening?).
>
> Thanx in advance,
>
> Andi
>
>
> --
> Andreas König
> Developer
>
>
-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/Eclipselink-7197-Null-primary-key-tp20738456p20773918.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.