Caused by: org.postgresql.util.PSQLException: ERROR: null value in column
"created_by" violates not-null constraint
I understand why this may happen. That at insert time the createdBy user
does not have an id yet. But since eclipselink already has it by getting
the next sequence value, I would hope it would assign it before trying to
do the insert.
Eclipselink should be able to handle this situation without me having to
take away my not null constraint so another update can make the user's
Am I correct in saying that this is not supported or am I doing something
What is the process for eclipselink to get and assign the sequence value
to the object? Does it get the next sequence value, then insert, then
update the entity? Would it make sence to have eclipselink get then next
sequence value, update the enity then do the insert so the sequnce value
can be used in other columns?
EclipseLink detect the circular reference, which could be made through
many entities. When this situation is encountered a shallow insert is
performed with the FK's updated on a subsequent call. In many situation
this is required but there are cases, such as this one where we may be
able to optimize.
I would suggest opening a bug referencing this posting.