alreadySeen.sync(); } catch (DatabaseException e) { logger.severe(e.getMessage()); logger.severe(e.getMessage()); alreadySeen.close(); } catch (DatabaseException e) { logger.severe(e.getMessage()); env.close(); } catch (DatabaseException e) { logger.severe(e.getMessage());
/** * Method used by BdbFrontier during checkpointing. * <p>The backing bdbje database has been marked deferred write so we save * on writes to disk. Means no guarantees disk will have what's in memory * unless a sync is called (Calling sync on the bdbje Environment is not * sufficient). * <p>Package access only because only Frontiers of this package would ever * need access. * @see <a href="http://www.sleepycat.com/jedocs/GettingStartedGuide/DB.html">Deferred Write Databases</a> */ protected void sync() { if (this.pendingUrisDB == null) { return; } try { this.pendingUrisDB.sync(); } catch (DatabaseException e) { e.printStackTrace(); } }
fireEventOccurred(new DatabaseErrorEvent(dbe.getMessage(), "[Validator - validate]")); } catch (FileNotFoundException fnfe) { e.printStackTrace(); } catch (DatabaseException e) { e.printStackTrace();
try { // Let EclipseLink execute query. } catch (DatabaseException e) { if (e.getCause() instanceof CommunicationsException) { // Handle. } }
/** * The terminating exception is wrapped in an EFE if it is not already a * DatabaseException (which is unexpected). Also text is added to the * message indicating it was thrown by an HA thread, since it will often be * re-thrown in an app thread and the stack trace may be confusing. */ private static DatabaseException prepareTerminatingException( final Exception e, final EnvironmentImpl envImpl) { if (e == null) { return null; } final DatabaseException de = (e instanceof DatabaseException) ? ((DatabaseException) e) : EnvironmentFailureException.unexpectedException(envImpl, e); de.addErrorMessage( "Originally thrown by HA thread: " + Thread.currentThread().getName()); return de; }
throw e; } catch (DatabaseException e) { Throwable cause = e.getCause(); if ((cause != null) && (cause.getClass() ==
} catch (DatabaseException e) { e.addErrorMessage("Problem closing handle " + nameIdPair); throw e; } catch (Exception e) {
logger.severe(e.getMessage());
public void close() { if(!hitLast) { hitLast = true; try { cursor.close(); } catch (DatabaseException e) { // TODO what to do? // let's just eat it for now.. e.printStackTrace(); } } }
environmentImpl.close(); } catch (DatabaseException e) { e.addErrorMessage(errors.toString()); throw e; } catch (RuntimeException e) {
protected boolean setRemove(CharSequence uri) { DatabaseEntry key = new DatabaseEntry(); LongBinding.longToEntry(createKey(uri), key); OperationStatus status = null; try { status = alreadySeen.delete(null, key); } catch (DatabaseException e) { logger.severe(e.getMessage()); } if (status == OperationStatus.SUCCESS) { count.decrementAndGet(); return true; // removed } else { return false; // not present } }
public void close() { if(!hitLast) { hitLast = true; try { cursor.close(); } catch (DatabaseException e) { // TODO what to do? // let's just eat it for now.. e.printStackTrace(); } } }
@Override public OutputWireRecord getWireRecord(VLSN vlsn, int waitTime) throws DatabaseException, InterruptedException, IOException { try { OutputWireRecord record = feederReader.scanForwards(vlsn, waitTime); if (record == null) { return null; } /* * Advance the protected file range when we advance to a new file, * to allow deletion of older files. Use getRangeStart (which is * not synchronized) to check whether the file has advanced, before * calling advanceRange (which is synchronized). This check must be * inexpensive and non-blocking. */ long lastFile = feederReader.getLastFile(record); if (lastFile > protectedFileRange.getRangeStart()) { protectedFileRange.advanceRange(lastFile); } return record; } catch (DatabaseException e) { /* Add more information */ e.addErrorMessage ("MasterFeederSource fetching vlsn=" + vlsn + " waitTime=" + waitTime); throw e; } }
throw new DatabaseInitException(message); } catch (DatabaseException e) { String message = "A database initialisation error has occured (" + e.getMessage() + ")"; throw new DatabaseInitException(message);
@Override public String toString() { try { return dump(); } catch (DatabaseException e) { e.printStackTrace(); return ""; } }
/** * Find the LSN, whether in a file or still in the log buffers. * Is public for unit testing. */ public LogSource getLogSource(long lsn) throws FileNotFoundException, ChecksumException, DatabaseException { /* * First look in log to see if this LSN is still in memory. */ LogBuffer logBuffer = logBufferPool.getReadBufferByLsn(lsn); if (logBuffer == null) { try { /* Not in the in-memory log -- read it off disk. */ long fileNum = DbLsn.getFileNumber(lsn); return new FileHandleSource (fileManager.getFileHandle(fileNum), readBufferSize, fileManager); } catch (DatabaseException e) { /* Add LSN to exception message. */ e.addErrorMessage("lsn= " + DbLsn.getNoFormatString(lsn)); throw e; } } return logBuffer; }
public class AddAction implements Action { public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { //get request parameters here.. try { //perform add action which throws exception.. return "success"; }catch(DatabaseException e) { request.setAttribute("errorMessage", e.getMessage());// to show exception msg in jsp. //log exception to console or file here.. return "failure"; } } }
public void close() { if (db != null) { try { db.close(); } catch (DatabaseException e) { // TODO use logger instead of out e.printStackTrace(); } } }
LoggerUtils.traceAndLogException(envImpl, "Txn", "undo", lsnMsg, e); e.addErrorMessage(lsnMsg); throw e; } catch (RuntimeException e) {
public void shutdown() throws IOException { try { shutdownDB(); } catch (DatabaseException e) { throw new IOException(e.getMessage()); } } }