Tabnine Logo
ISqlJetCursor.close
Code IndexAdd Tabnine to your IDE (free)

How to use
close
method
in
org.tmatesoft.sqljet.core.table.ISqlJetCursor

Best Java code snippets using org.tmatesoft.sqljet.core.table.ISqlJetCursor.close (Showing top 20 results out of 315)

origin: org.tmatesoft.sqljet/sqljet

public void close() throws SqlJetException {
  if (table != null) {
    table = null;
  }
  if (cursor != null) {
    cursor.close();
    cursor = null;
  }
}
origin: org.tmatesoft.sqljet/sqljet

public void close() throws SqlJetException {
  cursor.close();
}
origin: ha-jdbc/ha-jdbc

static void close(ISqlJetCursor cursor)
{
  try
  {
    cursor.close();
  }
  catch (SqlJetException e)
  {
    logger.log(Level.WARN, e);
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void reset() throws SVNException {
  binds.clear();
  if (isNeedsReset()) {
    try {
      getCursor().close();
    } catch (SqlJetException e) {
      SVNSqlJetDb.createSqlJetError(e);
    } finally {
      setCursor(null);
      sDb.commit();
    }
  }
}
origin: org.tmatesoft.svnkit/svnkit

private void resetCursor() throws SVNException {
  try {
    getCursor().close();
  } catch (SqlJetException e) {
    SVNSqlJetDb.createSqlJetError(e);
  }
  setCursor(openCursor());
}
origin: org.tmatesoft.svnkit/svnkit

private void resetCursor() throws SVNException {
  try {
    getCursor().close();
  } catch (SqlJetException e) {
    SVNSqlJetDb.createSqlJetError(e);
  }
  setCursor(openCursor());
}
origin: org.tmatesoft.svnkit/svnkit

private boolean exists(SqlJetDb db, long wcId, String localRelPath) throws SqlJetException {
  ISqlJetTable table = db.getTable(SVNWCDbSchema.NODES.name());
  ISqlJetCursor cursor = table.lookup(null, wcId, localRelPath);
  try {
    return !cursor.eof();
  } finally {
    cursor.close();
  }
}
origin: org.tmatesoft.svnkit/svnkit

  private boolean exists(SqlJetDb db, long wcId, String localRelPath) throws SqlJetException {
    ISqlJetTable table = db.getTable(SVNWCDbSchema.NODES.name());
    ISqlJetCursor cursor = table.lookup(null, wcId, localRelPath);
    try {
      return !cursor.eof();
    } finally {
      cursor.close();
    }
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void beforeInsert(SqlJetConflictAction conflictAction, ISqlJetTable table, Map<String, Object> newValues) throws SqlJetException {
  if (conflictAction == SqlJetConflictAction.REPLACE) {
    Object o1 = newValues.get(NODES__Fields.wc_id.toString());
    Object o2 = newValues.get(NODES__Fields.local_relpath.toString());
    Object o3 = newValues.get(NODES__Fields.op_depth.toString());
    ISqlJetCursor cursor = table.lookup(null, new Object[] {o1, o2, o3});
    try { 
      if (!cursor.eof()) {
        changeRefCount(cursor.getString(NODES__Fields.checksum.toString()), -1);
      }
    } finally {
      cursor.close();
    }
  }
  String newChecksumValue = (String) newValues.get(NODES__Fields.checksum.toString());
  changeRefCount(newChecksumValue, 1);
}
origin: org.tmatesoft.svnkit/svnkit

public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException {
  try {
    if (error == null && !getTriggerValues().isEmpty()) {
      Map<String, Object> values = new HashMap<String, Object>();
      ISqlJetTable pristineTable = db.getTable(SVNWCDbSchema.PRISTINE.toString());
      for (String checksum : getTriggerValues().keySet()) {
        long delta = getTriggerValues().get(checksum); 
        if (delta == 0) {
          continue;
        }
        ISqlJetCursor cursor = pristineTable.lookup(null, checksum);
        if (cursor != null && !cursor.eof()) {                        
          long refcount = cursor.getInteger(SVNWCDbSchema.PRISTINE__Fields.refcount.toString());
          refcount += delta;
          if (refcount < 0) {
            refcount = 0;
          }
          values.put(SVNWCDbSchema.PRISTINE__Fields.refcount.toString(), refcount);
          cursor.updateByFieldNames(values);
        }
        cursor.close();
      }
    }
  } finally {
    checksumTriggerValues = null;
  }
}
origin: org.tmatesoft.svnkit/svnkit

private String getNodeReposRelpath(long wcId, String path) throws SVNException {
  ISqlJetCursor cursor = null;
  try {
    cursor = getTable().lookup(null, wcId, path);
    if (!cursor.eof()) {
      return cursor.getString(NODES__Fields.repos_path.toString());
    }
  } catch (SqlJetException e) {
    SVNSqlJetDb.createSqlJetError(e);
  } finally {
    if (cursor != null) {
      try {
        cursor.close();
      } catch (SqlJetException e) {
      }
    }
  }
  return null;
}

origin: org.syncloud/syncloud-dao-sqljet

@Override
public void delete(String fullname) {
  try {
    db.beginTransaction(SqlJetTransactionMode.WRITE);
    try {
      ISqlJetTable table = db.getTable(StateTable.TABLE_NAME);
      ISqlJetCursor cursor = table.lookup(StateTable.NDX_FULL_NAME, fullname);
      while (!cursor.eof()) {
        cursor.delete();
      }
      cursor.close();
    } finally {
      db.commit();
    }
  } catch (Throwable e) {
    logger.error("unable to delete: " + fullname, e);
  }
}
origin: org.tmatesoft.svnkit/svnkit

public Long getMaxOpDepth(Long wcId, String localRelpath) throws SVNException {
  ISqlJetCursor c = null;
  try {
    c = getTable().lookup(null, wcId, localRelpath);
    c = c.reverse();
    if (!c.eof()) {
      long rowDepth = c.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString());
      if (rowDepth >= minDepth) {
        return rowDepth;
      }
    }
  } catch (SqlJetException e) {
    SVNSqlJetDb.createSqlJetError(e);
  } finally {
    try {
      c.close();
    } catch (SqlJetException e) {
    }
  }
  return null;
}
origin: org.tmatesoft.svnkit/svnkit

  public void transaction(SVNSqlJetDb db) throws SqlJetException, SVNException {
    try {
      db.beginTransaction(SqlJetTransactionMode.WRITE);
      final ISqlJetTable table = db.getDb().getTable(SVNWCDbSchema.NODES.name());
      ISqlJetCursor c = table.lookup(null, wcRoot.getWcId(), SVNFileUtil.getFilePath(localRelpath));
      c = c.reverse();
      if (!c.eof()) {
        final Map<String, Object> updateValues = new HashMap<String, Object>();
        updateValues.put(SVNWCDbSchema.NODES__Fields.translated_size.toString(), translatedSize);
        updateValues.put(SVNWCDbSchema.NODES__Fields.last_mod_time.toString(), lastModTime);
        c.updateByFieldNames(updateValues);
      }
      c.close();
      db.commit();
    } catch (SqlJetException e) {
      db.rollback();
      throw e;
    } catch (SVNException e) {
      db.rollback();
      throw e;
    }
  }
}
origin: org.tmatesoft.svnkit/svnkit

private static Map<SvnChecksum, Integer> calculateCorrectChecksumRefcounts(SVNWCDbRoot root) throws SVNException {
  Map<SvnChecksum, Integer> checksumToRefCount = new HashMap<SvnChecksum, Integer>();
  final SqlJetDb db = root.getSDb().getDb();
  try {
    final ISqlJetTable nodesTable = db.getTable(SVNWCDbSchema.NODES.name());
    db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
    final ISqlJetCursor cursor = nodesTable.open();
    for (; !cursor.eof(); cursor.next()) {
      String sha1ChecksumString = cursor.getString(SVNWCDbSchema.NODES__Fields.checksum.name());
      if (sha1ChecksumString == null) {
        continue;
      }
      SvnChecksum sha1Checksum = SvnChecksum.fromString(sha1ChecksumString);
      Integer refCount = checksumToRefCount.get(sha1Checksum);
      int incrementedRefCount = refCount == null ? 1 : refCount + 1;
      checksumToRefCount.put(sha1Checksum, incrementedRefCount);
    }
    cursor.close();
  } catch (SqlJetException e) {
    SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_DB_ERROR, e);
    SVNErrorManager.error(errorMessage, e, SVNLogType.WC);
  } finally {
    try {
      db.commit();
    } catch (SqlJetException ignore) {
    }
  }
  return checksumToRefCount;
}
origin: org.syncloud/syncloud-dao-sqljet

@Override
public State get(String fullname) {
  try {
    db.beginTransaction(SqlJetTransactionMode.WRITE);
    try {
      ISqlJetTable table = db.getTable(StateTable.TABLE_NAME);
      ISqlJetCursor cursor = table.lookup(StateTable.NDX_FULL_NAME, fullname);
      if (!cursor.eof()) {
        State state = read(cursor);
        cursor.close();
        return state;
      }
    } finally {
      db.commit();
    }
  } catch (Throwable e) {
    logger.error("unable to get " + fullname, e);
  }
  return null;
}
origin: org.tmatesoft.svnkit/svnkit

private FSRepresentationCacheRecord getByHash(final String hash) throws SVNException {
  ISqlJetCursor lookup = null;
  try {
    lookup = myTable.lookup(myTable.getPrimaryKeyIndexName(), new Object[] { hash });
    if (!lookup.eof()) {
      return new FSRepresentationCacheRecord(lookup);
    }
  } catch (SqlJetException e) {
    SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
  } finally {
    if (lookup != null) {
      try {
        lookup.close();
      } catch (SqlJetException e) {
        SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
      }
    }
  }
  return null;
}
origin: com.svnkit/com.springsource.org.tigris.subversion.javahl

private FSRepresentationCacheRecord getByHash(final String hash) throws SVNException {
  ISqlJetCursor lookup = null;
  try {
    lookup = myTable.lookup(myTable.getPrimaryKeyIndexName(), new Object[] { hash });
    if (!lookup.eof()) {
      return new FSRepresentationCacheRecord(lookup);
    }
  } catch (SqlJetException e) {
    SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
  } finally {
    if (lookup != null) {
      try {
        lookup.close();
      } catch (SqlJetException e) {
        SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
      }
    }
  }
  return null;
}
origin: org.jvnet.hudson.svnkit/svnkit

private FSRepresentationCacheRecord getByHash(final String hash) throws SVNException {
  ISqlJetCursor lookup = null;
  try {
    lookup = myTable.lookup(myTable.getPrimaryKeyIndexName(), new Object[] { hash });
    if (!lookup.eof()) {
      return new FSRepresentationCacheRecord(lookup);
    }
  } catch (SqlJetException e) {
    SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
  } finally {
    if (lookup != null) {
      try {
        lookup.close();
      } catch (SqlJetException e) {
        SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
      }
    }
  }
  return null;
}
origin: org.syncloud/syncloud-dao-sqljet

@Override
public void update(State state) {
  try {
    db.beginTransaction(SqlJetTransactionMode.WRITE);
    try {
      ISqlJetTable table = db.getTable(StateTable.TABLE_NAME);
      ISqlJetCursor cursor = table.lookup(StateTable.NDX_FULL_NAME, state.fullname);
      while (!cursor.eof()) {
        cursor.update(getData(state));
        cursor.next();
      }
      cursor.close();
    } finally {
      db.commit();
    }
  } catch (Throwable e) {
    logger.error("unable to update: " + state, e);
  }
}
org.tmatesoft.sqljet.core.tableISqlJetCursorclose

Javadoc

Closes the cursor.

Popular methods of ISqlJetCursor

  • eof
    Tests whether this cursor is positioned behind the last record.
  • getString
    Returns specified field's value as String.
  • isNull
    Tests field value for null.
  • getInteger
    Returns specified field's value as integer.
  • delete
    Deletes the current record.
  • getFieldsCount
    Returns number of fields in the current record.
  • next
    Goes to the next record.
  • getBlobAsArray
    Returns specified field's value as BLOB.
  • updateByFieldNames
    Updates the current record.
  • getBoolean
    Returns specified field's value as boolean.
  • getFieldType
    Returns field type.
  • getRowCount
    Returns number of rows accessible with this cursor.
  • getFieldType,
  • getRowCount,
  • getRowValues,
  • getValue,
  • setLimit,
  • update,
  • first,
  • getBlobAsStream,
  • getFloat

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now