After insert trigger (what if it fails ?)

  • Hello there,

    I have problem using triggers.

    I have important data on table1 which is updated all the time, and no interrupts are acceptable. Besides I need to mirror few records to other table residing on low security hardware (no RAIDs). For that task I choose 'after insert trigger' which basically does initial 'IF' check to determine if this entry has to be copied over to second table2. No problems so far. But as I wrote second table 'table2' resides on very unsecured disks. If disks with table 'table2' goes down trigger will not perform update of table2 and will fail and therefore initial insert to table1 will fail as well.

    Is there any settings to set on trigger which will make trigger NOT to ROLL BACK whole initial INSERT transactions?

    Any exp. is most welcome!!!

  • No the trigger will cause a roll back and has no setting to change this fact. The reason is the system expects to complete all request items within the batch to count as complete. You might want to consider replication which can resume once the other table is available again and will allow you to operate without the trigger as you currently have defined, thus no rollback.

  • No, if anything goes wrong, the whole transaction rolls back and that's the way it should be.

     

    I suggest maybe having a job run every X minutes to handle that update.  That way only the job could fail which would be easy to track and wouldn't corrupt anything else.

  • Ok, i see ...

    Anyway thanks guys for answers!!!

    With best regards

    Aivars

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply