* @param collection The Collection whose SymbolTable is required
* @return The requested SymbolTable
* @throws DBException If a Database Exception occurs
*/
public SymbolTable loadSymbols(Collection collection) throws DBException {
Transaction tx = new Transaction();
try {
userStack.pushCurrentUser(magicUser);
XMLSerializableAdapter symCol = getSymbolsCollection();
String colName = collection.getCanonicalName();
SymbolTable symbols = (SymbolTable)symCol.getObject(tx, colName);
if ( symbols == null ) {
symbols = new SymbolTable();
saveSymbols(collection, symbols);
}
return symbols;
}
catch ( DBException e ) {
tx.cancel();
e.printStackTrace(System.err);
throw e;
}
finally {
userStack.popCurrentUser();
if ( tx.getStatus() == Transaction.ACTIVE )
tx.commit();
}
}