mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 07:53:08 +00:00
Ds 3552 read only context and hibernate improvements (#1694)
* Refactor READ ONLY mode in Context and adjust hibernate settings accordingly * Set Context in READ-ONLY mode when retrieving community lists * Fix Hibernate EHCache configuration + fix some Hibernate warnings * Cache authorized actions and group membership when Context is in READ-ONLY mode * Set default Context mode * Let ConfigurableBrowse use a READ-ONLY context * Add 2nd level cache support for Site and EPerson DSpaceObjects * Added 2nd level caching for Community and Collection * Fix tests and license checks * Cache collection and community queries * Small refactorings + backwards compatibility * Set Context to READ-ONLY for JSPUI submissions and 'select collection' step * OAI improvements part 1 * OAI indexing improvements part 1 * OAI indexing improvements part 2 * DS-3552: Only uncache resource policies in AuthorizeService when in read-only * DS-3552: Additional comment on caching handles * DS-3552: Fix cache leakage in SolrServiceResourceRestrictionPlugin * DS-3552: Clear the read-only cache when switching Context modes * DS-3552: Correct Group 2nd level cache size * DS-3552: Always clear the cache, except when going from READ_ONLY to READ_ONLY
This commit is contained in:

committed by
Tim Donohue

parent
9f46a1b812
commit
1ccd6d1e13
@@ -47,10 +47,9 @@ public class IndexClient {
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SearchServiceException if something went wrong with querying the solr server
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
throws SQLException, IOException, SearchServiceException
|
||||
{
|
||||
Context context = new Context();
|
||||
public static void main(String[] args) throws SQLException, IOException, SearchServiceException {
|
||||
|
||||
Context context = new Context(Context.Mode.READ_ONLY);
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
String usage = "org.dspace.discovery.IndexClient [-cbhf] | [-r <handle>] | [-i <handle>] or nothing to update/clean an existing index.";
|
||||
@@ -151,8 +150,6 @@ public class IndexClient {
|
||||
throw new IllegalArgumentException("Cannot resolve " + handle + " to a DSpace object");
|
||||
}
|
||||
log.info("Forcibly Indexing " + handle);
|
||||
// Enable batch mode; we may be indexing a large number of items
|
||||
context.enableBatchMode(true);
|
||||
final long startTimeMillis = System.currentTimeMillis();
|
||||
final long count = indexAll(indexer, ContentServiceFactory.getInstance().getItemService(), context, dso);
|
||||
final long seconds = (System.currentTimeMillis() - startTimeMillis ) / 1000;
|
||||
|
Reference in New Issue
Block a user