fix for memory leak in SDB
This commit is contained in:
parent
2ad4348870
commit
aef7ef1a62
1 changed files with 18 additions and 2 deletions
|
@ -81,6 +81,8 @@ public class WebappDaoFactorySDBPrep implements Filter {
|
||||||
}
|
}
|
||||||
|
|
||||||
SDBConnection conn = null;
|
SDBConnection conn = null;
|
||||||
|
Store store = null;
|
||||||
|
Dataset dataset = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
|
@ -92,8 +94,8 @@ public class WebappDaoFactorySDBPrep implements Filter {
|
||||||
throw new RuntimeException("Unable to connect to database", sqe);
|
throw new RuntimeException("Unable to connect to database", sqe);
|
||||||
}
|
}
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
Store store = SDBFactory.connectStore(conn, _storeDesc);
|
store = SDBFactory.connectStore(conn, _storeDesc);
|
||||||
Dataset dataset = SDBFactory.connectDataset(store);
|
dataset = SDBFactory.connectDataset(store);
|
||||||
VitroRequest vreq = new VitroRequest((HttpServletRequest) request);
|
VitroRequest vreq = new VitroRequest((HttpServletRequest) request);
|
||||||
WebappDaoFactory wadf =
|
WebappDaoFactory wadf =
|
||||||
new WebappDaoFactorySDB(_oms, dataset, _defaultNamespace, null, null);
|
new WebappDaoFactorySDB(_oms, dataset, _defaultNamespace, null, null);
|
||||||
|
@ -114,7 +116,21 @@ public class WebappDaoFactorySDBPrep implements Filter {
|
||||||
} finally {
|
} finally {
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
conn.close();
|
conn.close();
|
||||||
|
conn = null;
|
||||||
}
|
}
|
||||||
|
if (dataset != null) {
|
||||||
|
dataset.close();
|
||||||
|
dataset = null;
|
||||||
|
}
|
||||||
|
if (store != null) {
|
||||||
|
store.close();
|
||||||
|
store = null;
|
||||||
|
}
|
||||||
|
_bds = null;
|
||||||
|
_storeDesc = null;
|
||||||
|
_conn = null;
|
||||||
|
_oms = null;
|
||||||
|
_defaultNamespace = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue