Deletes before Inserts?

From: Michael Gentry (mgentr..asslight.net)
Date: Mon May 10 2010 - 15:50:24 UTC

  • Next message: Andrus Adamchik: "Re: Deletes before Inserts?"

    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



    This archive was generated by hypermail 2.0.0 : Mon May 10 2010 - 15:51:17 UTC