예제 #1
0
파일: RESTCmd.java 프로젝트: LukasK/basex
  @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;
    }
  }
예제 #2
0
파일: AQuery.java 프로젝트: james-jw/basex
 @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;
   }
 }