Difference between Transaction.Commit and Transaction.CommitRetaining

4

Using FireDAC technology, I want to know exactly the difference between Commit and CommitRetaining .

I read in the official documentation of the FireDAC that CommitRetaining keeps transaction. But this gave me some doubts:

  • What impact does the application have on keeping the transaction open?
  • When I give a CommitRetaining for the tests I've done, the data already are available to other users (in other transactions) ... E this I could not understand, how can users of other transactions see what I'm manipulating in a transaction yet open?
  • In order to avoid DeadLocks on the system, which is recommended Commit or CommitRetaining ?
  • FireBird and Firebird and Oracle .

        
    asked by anonymous 15.03.2018 / 20:52

    1 answer

    3

    Focusing on the FireBird, this all pertains to "Transactional Isolation"

    The concept you know: I open a transaction, as long as I do not commit in this transaction, another transaction does not see this change nor can it move the same record.

    DeadLocks is different from Lock Conflit . What happens in transactions is Lock Conflit. Lock Conflit is of course a data protection, One transaction is tampering with this record, another transaction can not move at a time .

    At DELPHI they have created something that the people of "FDD" ( Firebird Developers Day, which I had the pleasure to participate in 2017 ) find "obdura". What is commitretaining . It COMMITS the transaction but still leaves it open. This concept does not exist EFFECTIVELY in the Database. Commit for Firebird "MEAN" record and "CLOSE".

    In the FDD they explained that using this is very bad because the transactions with commitretainig are still open and the Database needs to be still controlling them, which does officially lose performance in the Database.

    ALWAYS recommend: The shorter transactions (open, insert / change / delete, commit, or rollback) BETTER.

    Firebird Developers Day

        
    19.03.2018 / 12:19