| | |
| | | } |
| | | |
| | | /** |
| | | * This class is responsible for managing the configuraiton for VLV indexes |
| | | * This class is responsible for managing the configuration for VLV indexes |
| | | * used within this entry container. |
| | | */ |
| | | public class VLVJEIndexCfgManager implements |
| | |
| | | * Clear the contents for a database from disk. |
| | | * |
| | | * @param database The database to clear. |
| | | * @return The number of records deleted. |
| | | * @throws DatabaseException if a JE database error occurs. |
| | | */ |
| | | public long clearDatabase(DatabaseContainer database) |
| | | public void clearDatabase(DatabaseContainer database) |
| | | throws DatabaseException |
| | | { |
| | | long count = 0; |
| | | database.close(); |
| | | try |
| | | { |
| | |
| | | Transaction txn = beginTransaction(); |
| | | try |
| | | { |
| | | count = env.truncateDatabase(txn, database.getName(), true); |
| | | env.removeDatabase(txn, database.getName()); |
| | | transactionCommit(txn); |
| | | } |
| | | catch(DatabaseException de) |
| | |
| | | } |
| | | else |
| | | { |
| | | count = env.truncateDatabase(null, database.getName(), true); |
| | | env.removeDatabase(null, database.getName()); |
| | | } |
| | | } |
| | | finally |
| | |
| | | } |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugVerbose("Cleared %d existing records from the " + |
| | | "database %s", count, database.getName()); |
| | | TRACER.debugVerbose("Cleared the database %s", database.getName()); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | /** |