START TRANSACTION

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Natoli

    #1

    START TRANSACTION

    Does START TRANSACTION and COMMIT apply only to the Connection for which the
    START TRANSACTION statement was performed? So if a second Connection is
    created, and used to access different tables in the same database, are the
    tables affected by the second connection visible to other processes as the
    changes are made, not masked by the START TRANSACTION on the first
    Connection? Thanks.


  • Bill Karwin

    #2
    Re: START TRANSACTION

    Frank Natoli wrote:[color=blue]
    > Does START TRANSACTION and COMMIT apply only to the Connection for which the
    > START TRANSACTION statement was performed? So if a second Connection is
    > created, and used to access different tables in the same database, are the
    > tables affected by the second connection visible to other processes as the
    > changes are made, not masked by the START TRANSACTION on the first
    > Connection? Thanks.[/color]

    Yes, changes may be visible in the first transaction, but only if the
    first transaction was initiated with START TRANSACTION READ-COMMITTED or
    START TRANSACTION READ-UNCOMMITTED.

    But the default mode for InnoDB is not this. That is, if you use START
    TRANSACTION with no further arguments, it defaults to REPEATABLE READ
    mode. In this mode, you can see only the state of data at the moment
    you started the transaction. Other changes made by other clients since
    you started your transaction are not visible. That is, until you finish
    your transaction and begin a new one.

    Regards,
    Bill K.

    Comment

    Working...