public SVNFSFSRevPropSet(SVNSqlJetDb sDb) throws SqlJetException { super(sDb); table = sDb.getDb().getTable(FSFS.REVISION_PROPERTIES_TABLE); }
@Override public void execute(SqlJetDb db) throws SqlJetException { db.getTable(INVOCATION_TABLE).insert(transactionId, phase, exceptionType); } };
@Override public void execute(SqlJetDb db) throws SqlJetException { db.getTable(INVOKER_TABLE).insert(transactionId, phase, databaseId); } };
public SVNSqlJetTableStatement(SVNSqlJetDb sDb, String tableName) throws SVNException { super(sDb); this.tableName = tableName; try { table = sDb.getDb().getTable(tableName); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); } }
@Override public void execute(SqlJetDb db) throws SqlJetException { ISqlJetTable table = db.getTable(STATE_TABLE); table.clear(); for (String database: databases) { table.insert(database); } } };
public SVNWCDbCopyMoveNode(SVNSqlJetDb sDb) throws SqlJetException { super(sDb); table = sDb.getDb().getTable(SVNWCDbSchema.NODES.toString()); }
@Override public void execute(SqlJetDb db) throws SqlJetException { db.getTable(STATE_TABLE).insert(event.getSource()); } };
public SVNWCDbInsertLock(SVNSqlJetDb sDb) throws SqlJetException { super(sDb); table = sDb.getDb().getTable(SVNWCDbSchema.LOCK.toString()); }
public SVNWCDbInsertWCLock(SVNSqlJetDb sDb) throws SqlJetException { super(sDb); table = sDb.getDb().getTable(SVNWCDbSchema.WC_LOCK.toString()); }
public SVNWCDbReplaceWithBaseDeleted(SVNSqlJetDb sDb) throws SqlJetException { super(sDb); table = sDb.getDb().getTable(SVNWCDbSchema.LOCK.toString()); }
public SVNWCDbInsertWorkItem(SVNSqlJetDb sDb) throws SVNException { super(sDb); try { table = sDb.getDb().getTable(SVNWCDbSchema.WORK_QUEUE.toString()); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); } }
@Override public void execute(SqlJetDb database) throws SqlJetException { ISqlJetSchema schema = database.getSchema(); if (schema.getTable(STATE_TABLE) == null) { database.createTable(CREATE_STATE_SQL); } else if (Boolean.getBoolean(StateManager.CLEAR_LOCAL_STATE)) { database.getTable(STATE_TABLE).clear(); } } };
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(); } }
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(); } } }
public void beforeDelete(ISqlJetCursor cursor) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(NODES__Fields.local_relpath.toString())); rowValues.put(REVERT_LIST__Fields.actual.toString(), 0); rowValues.put(REVERT_LIST__Fields.op_depth.toString(), cursor.getValue(NODES__Fields.op_depth.toString())); rowValues.put(REVERT_LIST__Fields.repos_id.toString(), cursor.getValue(NODES__Fields.repos_id.toString())); rowValues.put(REVERT_LIST__Fields.kind.toString(), cursor.getValue(NODES__Fields.kind.toString())); table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
@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); } }
public static FSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException { final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager(); try { cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true); checkFormat(cacheObj.myRepCacheDB); cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } return cacheObj; }
public static FSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException { final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager(); try { cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true); checkFormat(cacheObj.myRepCacheDB); cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } return cacheObj; }
public void beforeUpdate(ISqlJetCursor cursor, Map<String, Object> newValues) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(ACTUAL_NODE__Fields.local_relpath.toString())); rowValues.put(REVERT_LIST__Fields.actual.toString(), 1); rowValues.put(REVERT_LIST__Fields.conflict_data.toString(), cursor.getBlobAsArray(ACTUAL_NODE__Fields.conflict_data.toString())); if (!cursor.isNull(ACTUAL_NODE__Fields.properties.toString()) || !cursor.isNull(ACTUAL_NODE__Fields.tree_conflict_data.toString())) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else if (!exists(db.getDb().getTemporaryDatabase(), cursor.getInteger(ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(ACTUAL_NODE__Fields.local_relpath.toString()))) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else { rowValues.put(REVERT_LIST__Fields.notify.toString(), null); } table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
public static IFSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException { final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager(); try { cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true); cacheObj.myRepCacheDB.setSafetyLevel(SqlJetSafetyLevel.OFF); checkFormat(cacheObj.myRepCacheDB); cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE); } catch (SqlJetException e) { SVNDebugLog.getDefaultLog().logError(SVNLogType.FSFS, e); return new FSEmptyRepresentationCacheManager(); } return cacheObj; }