Never Use "eclipselink.allow-zero-id" - It is Deprecated and has Side Effects
Last updated on AUGUST 16, 2016
Applies to:Oracle TopLink - Version 18.104.22.168 and later
Information in this document applies to any platform.
Raise awareness that "eclipselink.allow-zero-id" must never be used.
The "eclipselink.allow-zero-id" is known to cause side effects with the primary key generation on other applications.
It has been seen that this can end up in getting
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint violated
errors when trying to INSERT a new JPA object in the database table, because the primary key generation has been skipped due to the global effect or having "eclipselink.allow-zero-id" set in a different application and thus accepting Java's default 0 as a valid primary key, which the application normally would not want. (Such problems are very hard to spot.)
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms