Fixed inconsistent locking in database.
Previously, when table A had a foreign key pointing to table B, we got read locks on A and B to read A, a write lock on A and a read lock on B to update A, and a write lock on B to update B (but this wasn't applied consistently). Now we get a read lock on A to read A, a write lock on A to update A, and write locks on A and B to update B. The difference is small in practice, but clarifying the rules has helped to catch some bugs.
Showing
- briar-core/src/net/sf/briar/db/Database.java 47 additions, 51 deletionsbriar-core/src/net/sf/briar/db/Database.java
- briar-core/src/net/sf/briar/db/DatabaseComponentImpl.java 175 additions, 177 deletionsbriar-core/src/net/sf/briar/db/DatabaseComponentImpl.java
- briar-core/src/net/sf/briar/db/H2Database.java 8 additions, 0 deletionsbriar-core/src/net/sf/briar/db/H2Database.java
- briar-core/src/net/sf/briar/db/JdbcDatabase.java 17 additions, 22 deletionsbriar-core/src/net/sf/briar/db/JdbcDatabase.java
Loading
Please register or sign in to comment