cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Deletes before Inserts?
Date Mon, 10 May 2010 15:50:24 GMT
Is there a reason why INSERTs occur before DELETEs?  It looks like
this is the bit of code that orders it (at least in 3.0):

DataDomainFlushAction.java / preprocess

        insertBucket.appendQueries(queries);
        flattenedBucket.appendInserts(queries);
        updateBucket.appendQueries(queries);
        flattenedBucket.appendDeletes(queries);
        deleteBucket.appendQueries(queries);


There seems to be an issue if you have a DB constraint (unique column,
for example).  Say the "key" column needs to be unique and you delete
the record with key="timeout" and insert another new record with
key="timeout".  The commit will fail because the insert occurs before
the delete.

Thanks,

mrg

Mime
View raw message