merging changes for NIHVIVO-959 fillExistingObjectPropertyStatements error
This commit is contained in:
parent
32fa4851a6
commit
44976b4b72
2 changed files with 66 additions and 61 deletions
|
@ -638,13 +638,13 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
|||
} else {
|
||||
try {
|
||||
webappDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(this);
|
||||
Iterator stmtIt = this.getObjectPropertyStatements().iterator();
|
||||
while (stmtIt.hasNext()) {
|
||||
ObjectPropertyStatement stmt = (ObjectPropertyStatement) stmtIt.next();
|
||||
stmt.setObject(webappDaoFactory.getIndividualDao().getIndividualByURI(stmt.getObject().getURI()));
|
||||
}
|
||||
//Iterator stmtIt = this.getObjectPropertyStatements().iterator();
|
||||
//while (stmtIt.hasNext()) {
|
||||
// ObjectPropertyStatement stmt = (ObjectPropertyStatement) stmtIt.next();
|
||||
// stmt.setObject(webappDaoFactory.getIndividualDao().getIndividualByURI(stmt.getObject().getURI()));
|
||||
//}
|
||||
} catch (Exception e) {
|
||||
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI());
|
||||
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI(), e);
|
||||
}
|
||||
return this.objectPropertyStatements;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
|||
|
||||
ObjectPropertyDaoJena opDaoJena = new ObjectPropertyDaoJena(getWebappDaoFactory());
|
||||
|
||||
getOntModel().enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
Resource ind = getOntModel().getResource(entity.getURI());
|
||||
List<ObjectPropertyStatement> objPropertyStmtList = new ArrayList<ObjectPropertyStatement>();
|
||||
ClosableIterator<Statement> propIt = ind.listProperties();
|
||||
|
@ -116,6 +118,9 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
|||
propIt.close();
|
||||
}
|
||||
entity.setObjectPropertyStatements(objPropertyStmtList);
|
||||
} finally {
|
||||
getOntModel().leaveCriticalSection();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue