Verwenden Sie statt der Methode finalize() eine Bereinigungsmethode, die explizit aufgerufen wird.
public void free() {
try {
getContext().close();
}
catch (NamingException exc) {
LogUtility.log(exc);
}
}
private Context getContext() {
return _context;
}
private transient Context _context;
|
|