Tidied up resource handling that was causing scalability problems

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1251 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Jim Downing
2005-07-27 15:53:37 +00:00
parent 061e6010f4
commit 909f7595f1

View File

@@ -842,9 +842,21 @@ public class Browse
return totalInIndex;
}
PreparedStatement statement = createSql(scope, itemValue, true, true);
return getIntValue(statement);
PreparedStatement statement = null;
try {
statement = createSql(scope, itemValue, true, true);
return getIntValue(statement);
}
finally {
if(statement != null) {
try {
statement.close();
}
catch(SQLException e) {
log.error("Problem releasing statement", e);
}
}
}
}
private static int getPosition(int total, int matches, int beforeFocus)