NIHVIVO-3961 fixes bug with premature connection closing during URI refactoring
This commit is contained in:
parent
cf7f25af3b
commit
950be11440
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue