Incorrect synchronization in DatabaseImpl
Status: Beta
Brought to you by:
gmartone
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.
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".