Codota Logo
SqlJetDb.commit
Code IndexAdd Codota 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)

  • Common ways to obtain SqlJetDb
private void myMethod () {
SqlJetDb s =
  • Codota IconFile file;SqlJetDb.open(file, true)
  • Codota IconFSFS fSFS;SqlJetDb.open(fSFS.getRepositoryCacheFile(), true)
  • Smart code suggestions by Codota
}
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

  • Start an intent from android
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Table (org.hibernate.mapping)
    A relational table
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now