/** * Execute a isc_spb_rpr_* (repair) services operation. * * @param operation * The identifier for the operation to be executed * @throws SQLException * if a database access error occurs */ private void executeRepairOperation(int operation) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createRepairSRB(service, operation); executeServicesOperation(service, srb); } }
/** * Execute a isc_spb_prp_* (properties) services operation. * * @param operation * The identifier for the operation to be executed * @throws SQLException * if a database access error occurs */ private void executePropertiesOperation(int operation) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createPropertiesSRB(service, operation); executeServicesOperation(service, srb); } }
/** * Get a mostly-empty properties-operation request buffer that can be * filled as needed. * * @param service * Service handle * @param options * The options bitmask for the request buffer */ private ServiceRequestBuffer createPropertiesSRB(FbService service, int options) { return createRequestBuffer(service, isc_action_svc_properties, options); }
public void setForcedWrites(boolean forced) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createDefaultPropertiesSRB(service); srb.addArgument(isc_spb_prp_write_mode, (byte) (forced ? isc_spb_prp_wm_sync : isc_spb_prp_wm_async)); executeServicesOperation(service, srb); } }
private void handleTransaction(final int transactionId, final int action) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createDefaultRepairSRB(service); srb.addArgument(action, transactionId); executeServicesOperation(service, srb); } }
public List<Long> limboTransactionsAsList() throws SQLException { final OutputStream saveOut = getLogger(); final List<Long> result = new ArrayList<>(); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final byte[] output; try { setLogger(out); executeRepairOperation(isc_spb_rpr_list_limbo_trans); output = out.toByteArray(); } finally { setLogger(saveOut);
@Deprecated public void listLimboTransactions() throws SQLException { final PrintStream ps = new PrintStream(getLogger()); for (Long trId : limboTransactionsAsList()) { ps.print(trId + "\n"); } }
public void validateDatabase() throws SQLException { executeRepairOperation(isc_spb_rpr_validate_db); }
public void activateShadowFile() throws SQLException { executePropertiesOperation(isc_spb_prp_activate); }
/** * Get a mostly empty repair-operation buffer that can be filled in as * needed. The buffer created by this method cannot have the options * bitmask set on it. */ private ServiceRequestBuffer createDefaultRepairSRB(FbService service) { return createRepairSRB(service, 0); }
/** * Get a mostly empty properties-operation buffer that can be filled in as * needed. The buffer created by this method cannot have the options * bitmask set on it. */ private ServiceRequestBuffer createDefaultPropertiesSRB(FbService service) { return createPropertiesSRB(service, 0); }
public void setForcedWrites(boolean forced) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createDefaultPropertiesSRB(service); srb.addArgument(isc_spb_prp_write_mode, (byte) (forced ? isc_spb_prp_wm_sync : isc_spb_prp_wm_async)); executeServicesOperation(service, srb); } }
private void handleTransaction(final int transactionId, final int action) throws SQLException { try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createDefaultRepairSRB(service); srb.addArgument(action, transactionId); executeServicesOperation(service, srb); } }
public List<Long> limboTransactionsAsList() throws SQLException { final OutputStream saveOut = getLogger(); final List<Long> result = new ArrayList<>(); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final byte[] output; try { setLogger(out); executeRepairOperation(isc_spb_rpr_list_limbo_trans); output = out.toByteArray(); } finally { setLogger(saveOut);
@Deprecated public void listLimboTransactions() throws SQLException { final PrintStream ps = new PrintStream(getLogger()); for (Long trId : limboTransactionsAsList()) { ps.print(trId + "\n"); } }
public void markCorruptRecords() throws SQLException { executeRepairOperation(isc_spb_rpr_mend_db); }
public void bringDatabaseOnline() throws SQLException { executePropertiesOperation(isc_spb_prp_db_online); }
/** * Get a mostly empty repair-operation buffer that can be filled in as * needed. The buffer created by this method cannot have the options * bitmask set on it. */ private ServiceRequestBuffer createDefaultRepairSRB(FbService service) { return createRepairSRB(service, 0); }
/** * Get a mostly empty properties-operation buffer that can be filled in as * needed. The buffer created by this method cannot have the options * bitmask set on it. */ private ServiceRequestBuffer createDefaultPropertiesSRB(FbService service) { return createPropertiesSRB(service, 0); }
public void setDefaultCacheBuffer(int pageCount) throws SQLException { if (pageCount != 0 && pageCount < 50) { throw new IllegalArgumentException("page count must be 0 or >= 50, value was: " + pageCount); } try (FbService service = attachServiceManager()) { ServiceRequestBuffer srb = createDefaultPropertiesSRB(service); srb.addArgument(isc_spb_prp_page_buffers, pageCount); executeServicesOperation(service, srb); } }