Java Code Examples for com.sleepycat.je.DatabaseException#toString()

The following examples show how to use com.sleepycat.je.DatabaseException#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BJEStorageImplementation.java    From hypergraphdb with Apache License 2.0 6 votes vote down vote up
public boolean containsLink(HGPersistentHandle handle)
{
	DatabaseEntry key = new DatabaseEntry(handle.toByteArray());
	DatabaseEntry value = new DatabaseEntry();
	value.setPartial(0, 0, true);
	try
	{
		if (data_db.get(txn().getBJETransaction(), key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
		{
			// System.out.println(value.toString());
			return true;
		}
	}
	catch (DatabaseException ex)
	{
		throw new HGException("Failed to retrieve link with handle " + handle + ": " + ex.toString(), ex);
	}

	return false;
}
 
Example 2
Source File: BJEStorageImplementation.java    From hypergraphdb with Apache License 2.0 6 votes vote down vote up
public boolean containsData(HGPersistentHandle handle)
{
	DatabaseEntry key = new DatabaseEntry(handle.toByteArray());
	DatabaseEntry value = new DatabaseEntry();
	value.setPartial(0, 0, true);
	try
	{
		if (primitive_db.get(txn().getBJETransaction(), key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
		{
			return true;
		}
	}
	catch (DatabaseException ex)
	{
		throw new HGException("Failed to retrieve link with handle " + handle + ": " + ex.toString(), ex);
	}
	return false;
}