Menu

#16 Incorrect synchronization in DatabaseImpl

release_1.0
open-accepted
sql module (15)
9
2005-04-28
2005-04-28
No

As suggested by maryuk naik at
http://sourceforge.net/forum/message.php?
msg_id=3047749
there is a bug caused by bad usage of synchronize.

Discussion

  • Giovanni Martone

    • status: open --> open-accepted
     
  • mayur_naik

    mayur_naik - 2005-05-22

    Logged In: YES
    user_id=1237052

    The rollback method in class DatabaseImpl must be
    synchronized on "this".

    Synchronizing on just the "dbs" field in method
    rollbackTransaction is not enough. In particular, there is
    a race on the "transaction" field in the rollback method
    because every other method in DatabaseImpl (e.g. begin,
    close, commit) accesses (i.e. reads/writes) "transaction" by
    synchronizing on "this", but the rollback method accesses
    (i.e. reads) "transaction" without synchronizing on "this".

     

Log in to post a comment.

MongoDB Logo MongoDB