Open loicjaouen opened 7 years ago
I don't think that you need to restart Knora to be able to see a new project. Or at least, I don't see why this shouldn't work as expected. The project information is stored inside the triplestore and can be updated as all other things that are stored there. Maybe Salsah is not refreshing the list correctly?
Yes, the session information is not persisted during Knora restarts. I think that the cache that we use now has the ability to be persisted. It is simply not done at the moment.
@subotic
I don't think that you need to restart Knora to be able to see a new project.
Apparently, at start time, Knora requests and caches the list of named graphs and doesn't refresh it afterward.
I added a couple of projects and their matching ontologies, user, permissions, list values and project definitions.
Without restarting the platform, Salsah makes the following requests to the knora API:
GET http://knora-test.unil.ch/v1/vocabularies
GET http://knora-test.unil.ch/v1/projects
GET http://knora-test.unil.ch/v1/resourcetypes?vocabulary=0
The first two requests answer with the updated information, including the projects and ontologies.
The latter sends back a HTTP 500
to complain about:
{
"status":4,
"error":"org.knora.webapi.InconsistentTriplestoreDataException: Named graph not found: http://www.knora.org/ontology/atelier-fabula-biblio"
}
And knora complains about:
[2017-05-18 14:23:34,447] ERROR - KnoraService(akka://webapi) - Unable to run route http://knora-test.unil.ch/v1/resourcetypes?vocabulary=0
org.knora.webapi.InconsistentTriplestoreDataException: Named graph not found: http://www.knora.org/ontology/atelier-fabula-biblio
at org.knora.webapi.util.ErrorHandlingMap$.$anonfun$$lessinit$greater$default$3$1(ErrorHandlingMap.scala:42)
at org.knora.webapi.util.ErrorHandlingMap.default(ErrorHandlingMap.scala:84)
at scala.collection.MapLike.apply(MapLike.scala:141)
at scala.collection.MapLike.apply$(MapLike.scala:140)
at org.knora.webapi.util.ErrorHandlingMap.apply(ErrorHandlingMap.scala:40)
at org.knora.webapi.responders.v1.OntologyResponderV1.$anonfun$getNamedGraphEntityInfoV1ForNamedGraph$1(OntologyResponderV1.scala:911)
After a restart, everything runs smoothly.
Apparently, at start time, Knora requests and caches the list of named graphs and doesn't refresh it afterward.
This is true. OntologyResponderV1
reads and caches all ontology information when Knora starts. This was implemented in PR #252 because of issue #185. Among other things, the cache contains a map of named graph IRIs to the set of ontology information found in each named graph. I always figured we would need to implement an API operation to refresh the cache, but I thought we could wait until someone complained about it. :) So maybe the time has come to do that.
Restarting Knora is needed for it to read the project's list: it is not possible to add a project without knora.
The user connections are not persistent to a restart.
So the user sees this:
It would be better to: