Exemplo n.º 1
0
 synchronized void invalidate__wrappee__base() {
   state = INVALID;
   envHandle.removeReferringHandle(this);
   if (databaseImpl != null) {
     databaseImpl.removeReferringHandle(this);
   }
 }
Exemplo n.º 2
0
 public JoinCursor join__wrappee__base(Cursor[] cursors, JoinConfig config)
     throws DatabaseException {
   checkEnv();
   checkRequiredDbState(OPEN, "Can't call Database.join");
   DatabaseUtil.checkForNullParam(cursors, "cursors");
   if (cursors.length == 0) {
     throw new IllegalArgumentException("At least one cursor is required.");
   }
   Locker locker = cursors[0].getCursorImpl().getLocker();
   if (!locker.isTransactional()) {
     EnvironmentImpl env = envHandle.getEnvironmentImpl();
     for (int i = 1; i < cursors.length; i += 1) {
       Locker locker2 = cursors[i].getCursorImpl().getLocker();
       if (locker2.isTransactional()) {
         throw new IllegalArgumentException("All cursors must use the same transaction.");
       }
       EnvironmentImpl env2 = cursors[i].getDatabaseImpl().getDbEnvironment();
       if (env != env2) {
         throw new IllegalArgumentException("All cursors must use the same environment.");
       }
     }
     locker = null;
   } else {
     for (int i = 1; i < cursors.length; i += 1) {
       Locker locker2 = cursors[i].getCursorImpl().getLocker();
       if (locker.getTxnLocker() != locker2.getTxnLocker()) {
         throw new IllegalArgumentException("All cursors must use the same transaction.");
       }
     }
   }
   return new JoinCursor(locker, this, cursors, config);
 }
Exemplo n.º 3
0
 public synchronized void close__wrappee__base() throws DatabaseException {
   StringBuffer errors = null;
   checkEnv();
   checkProhibitedDbState(CLOSED, "Can't close Database:");
   this.hook44();
   removeAllTriggers();
   envHandle.removeReferringHandle(this);
   if (cursors.size() > 0) {
     errors = new StringBuffer("There are open cursors against the database.\n");
     errors.append("They will be closed.\n");
     Iterator iter = cursors.copy().iterator();
     while (iter.hasNext()) {
       Cursor dbc = (Cursor) iter.next();
       try {
         dbc.close();
       } catch (DatabaseException DBE) {
         errors.append("Exception while closing cursors:\n");
         errors.append(DBE.toString());
       }
     }
   }
   if (databaseImpl != null) {
     databaseImpl.removeReferringHandle(this);
     databaseImpl = null;
     handleLocker.setHandleLockOwner(true, this, true);
     handleLocker.operationEnd(true);
     state = CLOSED;
   }
   if (errors != null) {
     throw new DatabaseException(errors.toString());
   }
 }
Exemplo n.º 4
0
 void checkEnv__wrappee__base() throws RunRecoveryException {
   EnvironmentImpl env = envHandle.getEnvironmentImpl();
   if (env != null) {
     env.checkIfInvalid();
   }
 }