My Oracle Support Banner

ValidationException.nullPrimaryKeyInUnitOfWorkClone Exception When Using Zero as a Primary Key (Doc ID 1536334.1)

Last updated on MARCH 04, 2019

Applies to:

Oracle TopLink - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

An entity UserEntity is defined mapping to this database table :

CREATE TABLE usur_AUX (
ID NUMBER NOT NULL PRIMARY KEY,
NOMBRE VARCHAR(32),
APEL1 VARCHAR(32),
APEL2 VARCHAR(32)
);

One row has been inserted with a primary key id equal to 0 :

INSERT INTO usur_AUX VALUES (0,'PRUEB','PRUEB','PRUEB');



After fetching the UserEntity with ID equal to 0 , this entity is updated with the following code
 (where  UserEntity usur is containing the new attribute values of the entity ) :

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.