rollback OR commit selected operations only

Jawab rollback OR commit selected operations only

  • Dienstag, 6. März 2012 05:09
     
     

    In a transaction block for example i have 5 insert statements:

    BEGIN TRANSACTION

    Insert A --Should be commited

    Insert B

    Insert C--Should be commited

    Insert D

    Insert E

    COMMIT TRANSACTION.

    Now let's suppose, statement E got failed, and while rolling back the whole bunch of statements, I want statement A and C to be commit ed. Is it possible?



    .Net


Alle Antworten

  • Dienstag, 6. März 2012 05:55
     
     Beantwortet

    Hello,

    No, that's not possible in this way. You can commit every changes done within a transaction or rollback everything, bit you can't commit particular operations. In case of a rollback you could only redo this operations, but then you could do them already outside the transaction instead of within it.


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    • Als Antwort markiert KJian_ Montag, 12. März 2012 06:37
    •