Tabnine Logo
SqlJetDb.commit
Code IndexAdd Tabnine to your IDE (free)

How to use
commit
method
in
org.tmatesoft.sqljet.core.table.SqlJetDb

Best Java code snippets using org.tmatesoft.sqljet.core.table.SqlJetDb.commit (Showing top 17 results out of 315)

origin: ha-jdbc/ha-jdbc

private <T> T execute(Query<T> query, DB db) throws SqlJetException
{
  Pool<SqlJetDb, SqlJetException> pool = this.pools.get(db);
  Lock lock = this.locks.get(db).readLock();
  
  SqlJetDb database = pool.take();
  
  lock.lock();
  
  try
  {
    database.beginTransaction(SqlJetTransactionMode.READ_ONLY);
    
    try
    {
      return query.execute(database);
    }
    finally
    {
      database.commit();
    }
  }
  finally
  {
    lock.unlock();
    
    pool.release(database);
  }
}
origin: org.syncloud/syncloud-dao-sqljet

private void createStructure(SqlJetDb db) throws SqlJetException {
  db.beginTransaction(SqlJetTransactionMode.WRITE);
  try {
    db.createTable("CREATE TABLE states (full_name TEXT NOT NULL PRIMARY KEY, version TEXT NULL)");
    db.createIndex("CREATE INDEX full_name_index ON states(full_name)");
  } finally {
    db.commit();
  }
}
origin: ha-jdbc/ha-jdbc

database.commit();
origin: org.tmatesoft.svnkit/svnkit

public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException {
  if (error == null) {
    this.db.getDb().getTemporaryDatabase().commit();
  } else {
    this.db.getDb().getTemporaryDatabase().rollback();
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException {
  if (error == null) {
    this.db.getDb().getTemporaryDatabase().commit();
  } else {
    this.db.getDb().getTemporaryDatabase().rollback();
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException {
  if (error == null) {
    this.db.getDb().getTemporaryDatabase().commit();
  } else {
    this.db.getDb().getTemporaryDatabase().rollback();
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException {
  if (error == null) {
    this.db.getDb().getTemporaryDatabase().commit();
  } else {
    this.db.getDb().getTemporaryDatabase().rollback();
  }
}
origin: org.syncloud/syncloud-dao-sqljet

@Override
public void insert(State state) {
  try {
    db.beginTransaction(SqlJetTransactionMode.WRITE);
    try {
      ISqlJetTable table = db.getTable(StateTable.TABLE_NAME);
      table.insert(getData(state));
    } finally {
      db.commit();
    }
  } catch (Throwable e) {
    logger.error("unable to insert: " + state, e);
  }
}
origin: org.tmatesoft.svnkit/svnkit

public void commit() throws SVNException {
  if (openCount > 0) {
    openCount--;
    if (isLogTransactions()) {
      logCall("Commit transaction request (" + openCount + ")", 5);
    }
    if (openCount == 0) {
      try {
        db.commit();
        if (isLogTransactions()) {
          SVNDebugLog.getDefaultLog().logFine(SVNLogType.DEFAULT, "transaction committed");
        }
      } catch (SqlJetException e) {
        createSqlJetError(e);
      }
    }
  } else {
    SVNErrorManager.assertionFailure(openCount > 0, "no opened transactions", SVNLogType.WC);
  }
}
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

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.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);
  }
}
origin: org.tmatesoft.svnkit/svnkit

  sqljetDb.commit();
} catch (SqlJetException e) {
  SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.SQLITE_ERROR, e);
origin: org.tmatesoft.svnkit/svnkit

private static Map<SvnChecksum, Integer> loadChecksumsRefcountsFromTable(SVNWCDbRoot root) throws SVNException {
  Map<SvnChecksum, Integer> checksumToRefCount = new HashMap<SvnChecksum, Integer>();
  final SqlJetDb db = root.getSDb().getDb();
  try {
    final ISqlJetTable pristineTable = db.getTable(SVNWCDbSchema.PRISTINE.name());
    db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
    final ISqlJetCursor cursor = pristineTable.open();
    for (; !cursor.eof(); cursor.next()) {
      String sha1ChecksumString = cursor.getString(PRISTINE__Fields.checksum.name());
      if (sha1ChecksumString == null) {
        continue;
      }
      SvnChecksum sha1Checksum = SvnChecksum.fromString(sha1ChecksumString);
      long refcount = cursor.getInteger(PRISTINE__Fields.refcount.name());
      checksumToRefCount.put(sha1Checksum, (int)refcount);
    }
    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.tmatesoft.svnkit/svnkit

  sqljetDb.commit();
} catch (SqlJetException e) {
  SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.SQLITE_ERROR, e);
origin: org.tmatesoft.svnkit/svnkit

  sqljetDb.commit();
} catch (SqlJetException e) {
  SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.SQLITE_ERROR, e);
org.tmatesoft.sqljet.core.tableSqlJetDbcommit

Popular methods of SqlJetDb

  • getTable
    Open table.
  • open
  • close
  • getOptions
  • createIndex
    Create index from SQL clause.
  • createTable
    Create table from SQL clause.
  • runWithLock
    Do some actions with locking database's internal threads synchronization mutex. It is related only w
  • runWriteTransaction
    Run modifications in write transaction.
  • beginTransaction
  • getSchema
    Get database schema.
  • runReadTransaction
    Run read-only transaction.
  • dropIndex
    Drop index.
  • runReadTransaction,
  • dropIndex,
  • dropTable,
  • getTemporaryDatabase,
  • isInTransaction,
  • isOpen,
  • rollback,
  • <init>,
  • alterTable

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for Android Studio
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