Package com.sleepycat.je

Examples of com.sleepycat.je.DatabaseException


             * Catch Throwable here (rather than exception) because in unit
             * test mode, we run assertions and they throw errors. We want to
             * clean up the file object in all cases.
             */
            closeFileInErrorCase(newFile);
            throw new DatabaseException
    ("Couldn't open file " + fileName + ": " + t, t);
        }
    }
View Full Code Here


      throw new IOException("generated for testing");
        }
        writeToFile(file, data, DbLsn.getFileOffset(firstLsn));
    } catch (IOException IOE2) {
        fullBuffer.setRewriteAllowed();
        throw new DatabaseException(IOE2);
    }
      }

      assert EnvironmentImpl.maybeForceYield();
        }
View Full Code Here

         !keyLine.equals("DATA=END")) {
      dataLine = reader.readLine();
      /* Add one for \n or \r. */
      bytesReadThisInterval += dataLine.length() + 1;
            if (dataLine == null) {
                throw new DatabaseException("No data to match key " +
                                            keyLine);
            }
      byte[] keyBytes = loadLine(keyLine.trim());
      byte[] dataBytes = loadLine(dataLine.trim());

View Full Code Here

          int b = Character.digit(c1, 16);
          b <<= 4;
          b += Character.digit(c2, 16);
          ba[actualNBytes++] = (byte) b;
      } else {
          throw new DatabaseException("Corrupted file");
      }
        }
    } else {
        throw new DatabaseException("Corrupted file");
    }
      } else {
    ba[actualNBytes++] = (byte) (c & 0xff);
      }
  }
View Full Code Here

        throws DatabaseException {

        try {
            endOfLog.force();
        } catch (IOException e) {
            throw new DatabaseException(e);
        }
    }
View Full Code Here

        try {
            if (exclLock != null) {
                exclLock.release();
            }
        } catch (IOException IOE) {
            throw new DatabaseException(IOE);
        }
    }
View Full Code Here

  throws DatabaseException {

  boolean envDirIsReadOnly = !dbEnvHome.canWrite();
  if (envDirIsReadOnly &&
      !readOnly) {
      throw new DatabaseException
    ("The Environment directory " +
                 dbEnvHome +
                 " is not writable, but the " +
     "Environment was opened for read-write access.");
  }
View Full Code Here

                        try {
                            fileMap.remove(evictId);
                            iter.remove();
                            evictTarget.close();
                        } catch (IOException e) {
                            throw new DatabaseException (e);
                        } finally {
                            evictTarget.release();
                        }
                        break;
                    }
View Full Code Here

            // Log a message
            Tracer.trace(Level.INFO, env, "hi there");
            expectedRecords.add(new Tracer("hi there"));

            // Log an exception
            DatabaseException e = new DatabaseException("fake exception");
            Tracer.trace(env, "DebugRecordTest", "testException", "foo", e);
            expectedRecords.add(new Tracer("foo\n" + Tracer.getStackTrace(e)));
                           
            // Log a split
            // Flush the log to disk
View Full Code Here

            /*
             * The user provided a transaction, the environment and the
             * database had better be opened transactionally.
             */
            if (!envIsTransactional) {
                throw new DatabaseException
        ("A Transaction cannot be used because the"+
         " environment was opened" +
         " non-transactionally");
            }
            if (!dbIsTransactional) {
                throw new DatabaseException
        ("A Transaction cannot be used because the" +
         " database was opened" +
         " non-transactionally");
            }

View Full Code Here

TOP

Related Classes of com.sleepycat.je.DatabaseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.