* 数据操作异常
*/
private void clear(IMetaData data) throws Exception {
SecondaryDatabase db = dbKeys.get(data.getName());
if (db != null) {
Transaction tran = env.beginTransaction(null, null);
DatabaseEntry key = new DatabaseEntry(data.getBytes());
DatabaseEntry pKey = new DatabaseEntry();
DatabaseEntry pData = new DatabaseEntry();
try {
SecondaryCursor cursor = db.openSecondaryCursor(tran, null);
try {
OperationStatus ret = cursor.getSearchKey(key, pKey, pData, null);
while (ret == OperationStatus.SUCCESS) {
cursor.delete();
dataBinding.entryToObject(pData).remove();
ret = cursor.getNextDup(pKey, pData, null);
}
} finally {
cursor.close();
}
tran.commit();
} catch (Exception e) {
tran.abort();
throw e;
}
}
}