mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 05:23:14 +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
|
@Override
|
||||||
public void end(Context ctx) throws Exception {
|
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 {
|
try {
|
||||||
for (String uid : uniqueIdsToDelete) {
|
for (String uid : uniqueIdsToDelete) {
|
||||||
try {
|
try {
|
||||||
@@ -231,6 +235,8 @@ public class IndexEventConsumer implements Consumer {
|
|||||||
createdItemsToUpdate.clear();
|
createdItemsToUpdate.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.setMode(originalMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void indexObject(Context ctx, IndexableObject iu, boolean preDb) throws SQLException {
|
private void indexObject(Context ctx, IndexableObject iu, boolean preDb) throws SQLException {
|
||||||
|
Reference in New Issue
Block a user