congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SqlJetDb.beginTransaction
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.tmatesoft.svnkit/svnkit

public void statementStarted(SqlJetDb db) throws SqlJetException {
  this.db.getDb().getTemporaryDatabase().beginTransaction(SqlJetTransactionMode.WRITE);
}
origin: org.tmatesoft.svnkit/svnkit

public void statementStarted(SqlJetDb db) throws SqlJetException {
  this.db.getDb().getTemporaryDatabase().beginTransaction(SqlJetTransactionMode.WRITE);
}
origin: org.tmatesoft.svnkit/svnkit

public void statementStarted(SqlJetDb db) throws SqlJetException {
  this.db.getDb().getTemporaryDatabase().beginTransaction(SqlJetTransactionMode.WRITE);
}
origin: org.tmatesoft.svnkit/svnkit

public void statementStarted(SqlJetDb db) throws SqlJetException {
  this.db.getDb().getTemporaryDatabase().beginTransaction(SqlJetTransactionMode.WRITE);
}
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.beginTransaction(SqlJetTransactionMode.WRITE);
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

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 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.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

public void beginTransaction(SqlJetTransactionMode mode) throws SVNException {
  if (mode != null) {
    openCount++;
    if (isLogTransactions()) {
      logCall("Being transaction request (" + openCount + "): " + mode, 5);
    }
    if (isNeedStartTransaction(mode)) {
      try {
        db.beginTransaction(mode);
        if (isLogTransactions()) {
          SVNDebugLog.getDefaultLog().logFine(SVNLogType.DEFAULT, "transaction started");
        }
      } catch (SqlJetException e) {
        createSqlJetError(e);
      }
    }
  } else {
    SVNErrorManager.assertionFailure(mode != null, "transaction mode is null", SVNLogType.WC);
  }
}
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.beginTransaction(SqlJetTransactionMode.READ_ONLY);
ISqlJetTable nodesTable = sqljetDb.getTable(SVNWCDbSchema.NODES.toString());
String parentRelPath = null;
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.beginTransaction(SqlJetTransactionMode.READ_ONLY);
ISqlJetTable nodesTable = sqljetDb.getTable(SVNWCDbSchema.NODES.toString());
cursor = nodesTable.scope(null, new Object[] {wcId, localRelPathStr}, null);
origin: org.tmatesoft.svnkit/svnkit

boolean matched = false;
try {
  sqljetDb.beginTransaction(SqlJetTransactionMode.READ_ONLY);
  ISqlJetTable nodesTable = sqljetDb.getTable(SVNWCDbSchema.NODES.toString());
  cursor = nodesTable.scope(null, new Object[] {wcId, localRelPathStr}, null);
org.tmatesoft.sqljet.core.tableSqlJetDbbeginTransaction

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.
  • commit
  • 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)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • ImageIO (javax.imageio)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JButton (javax.swing)
  • From CI to AI: The AI layer in your organization
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