NIHVIVO-3961 fixes bug with premature connection closing during URI refactoring

This commit is contained in:
brianjlowe 2012-09-14 18:13:02 +00:00
parent cf7f25af3b
commit 950be11440

View file

@ -147,7 +147,7 @@ public class RDFServiceSDB extends RDFServiceJena implements RDFService {
}
throw new RDFServiceException(e);
} finally {
conn.close();
close(conn);
}
return true;
@ -156,6 +156,12 @@ public class RDFServiceSDB extends RDFServiceJena implements RDFService {
protected Connection getConnection() throws SQLException {
return (conn != null) ? conn : ds.getConnection();
}
protected void close(SDBConnection sdbConn) {
if (!sdbConn.getSqlConnection().equals(conn)) {
sdbConn.close();
}
}
protected Dataset getDataset(SDBConnection conn) {
Store store = SDBFactory.connectStore(conn, storeDesc);