Exemple #1
0
  @Override
  public void databases(final LockResult lr) {
    for (final Command c : cmds) c.databases(lr);

    // lock globally if context-dependent is found (context will be changed by commands)
    final boolean wc = lr.write.contains(DBLocking.CTX) || lr.write.contains(DBLocking.COLL);
    final boolean rc = lr.read.contains(DBLocking.CTX) || lr.read.contains(DBLocking.COLL);
    if (wc || rc && !lr.write.isEmpty()) {
      lr.writeAll = true;
      lr.readAll = true;
    } else if (rc) {
      lr.readAll = true;
    }
  }
Exemple #2
0
 @Override
 public void databases(final LockResult lr) {
   if (qp == null) {
     lr.writeAll = true;
   } else {
     qp.databases(lr);
     info.readLocked = lr.readAll ? null : lr.read;
     info.writeLocked = lr.writeAll ? null : lr.write;
   }
 }