NIHVIVO-3569 added missing model lock to avoid ConcurrentModificationException when creating/retrieving a data property (merge from 1.4 maint branch)
This commit is contained in:
parent
45657d6684
commit
5e7b538255
1 changed files with 7 additions and 1 deletions
|
@ -459,7 +459,13 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataProperty getDataPropertyByURI(String dataPropertyURI) {
|
public DataProperty getDataPropertyByURI(String dataPropertyURI) {
|
||||||
return datapropFromOntProperty(getOntModelSelector().getTBoxModel().getDatatypeProperty(dataPropertyURI));
|
OntModel tboxModel = getOntModelSelector().getTBoxModel();
|
||||||
|
tboxModel.enterCriticalSection(Lock.READ);
|
||||||
|
try {
|
||||||
|
return datapropFromOntProperty(tboxModel.getDatatypeProperty(dataPropertyURI));
|
||||||
|
} finally {
|
||||||
|
tboxModel.leaveCriticalSection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String insertDataProperty(DataProperty dtp) throws InsertException{
|
public String insertDataProperty(DataProperty dtp) throws InsertException{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue