mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
indexing in transactional context
This commit is contained in:
parent
229d845a42
commit
5c5a3f614f
@ -38,9 +38,9 @@ public class DocumentCreatedAsyncListener {
|
|||||||
contributor.setDocumentId(event.getDocument().getId());
|
contributor.setDocumentId(event.getDocument().getId());
|
||||||
contributor.setUserId(event.getUserId());
|
contributor.setUserId(event.getUserId());
|
||||||
contributorDao.create(contributor);
|
contributorDao.create(contributor);
|
||||||
|
|
||||||
|
// Update Lucene index
|
||||||
|
AppContext.getInstance().getIndexingHandler().createDocument(event.getDocument());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update Lucene index
|
|
||||||
AppContext.getInstance().getIndexingHandler().createDocument(event.getDocument());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class DocumentUpdatedAsyncListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TransactionUtil.handle(() -> {
|
TransactionUtil.handle(() -> {
|
||||||
// Update Lucene index
|
// Update index
|
||||||
DocumentDao documentDao = new DocumentDao();
|
DocumentDao documentDao = new DocumentDao();
|
||||||
Document document = documentDao.getById(event.getDocumentId());
|
Document document = documentDao.getById(event.getDocumentId());
|
||||||
if (document == null) {
|
if (document == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user