mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 21:13:19 +00:00
Change the database mode to READ_ONLY during the indexing by discovery consumer (IndexEventConsumer)
This commit is contained in:
@@ -201,6 +201,10 @@ public class IndexEventConsumer implements Consumer {
|
||||
@Override
|
||||
public void end(Context ctx) throws Exception {
|
||||
|
||||
// Change the mode to readonly to improve the performance
|
||||
Context.Mode originalMode = ctx.getCurrentMode();
|
||||
ctx.setMode(Context.Mode.READ_ONLY);
|
||||
|
||||
try {
|
||||
for (String uid : uniqueIdsToDelete) {
|
||||
try {
|
||||
@@ -231,6 +235,8 @@ public class IndexEventConsumer implements Consumer {
|
||||
createdItemsToUpdate.clear();
|
||||
}
|
||||
}
|
||||
|
||||
ctx.setMode(originalMode);
|
||||
}
|
||||
|
||||
private void indexObject(Context ctx, IndexableObject iu, boolean preDb) throws SQLException {
|
||||
|
Reference in New Issue
Block a user