Skip to content

Commit

Permalink
HSEARCH-3816 Sonar: Generic exceptions should never be thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Jan 27, 2020
1 parent c5daf80 commit e928c0c
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -14,6 +14,8 @@
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import javax.persistence.metamodel.SingularAttribute;
import javax.transaction.NotSupportedException;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;

import org.hibernate.CacheMode;
Expand Down Expand Up @@ -105,7 +107,7 @@ public void run() {
log.trace( "finished" );
}

private void loadAllFromQueue(SessionImplementor session) throws Exception {
private void loadAllFromQueue(SessionImplementor session) throws SystemException, NotSupportedException {
// The search session will be closed automatically with the ORM session
PojoIndexer indexer = mappingContext.createIndexer(
session, DocumentCommitStrategy.NONE
Expand Down Expand Up @@ -136,7 +138,8 @@ private void loadAllFromQueue(SessionImplementor session) throws Exception {
* @param session the session to be used
* @param indexer the indexer to be used
*/
private void loadList(List<I> listIds, SessionImplementor session, PojoIndexer indexer) throws Exception {
private void loadList(List<I> listIds, SessionImplementor session, PojoIndexer indexer)
throws InterruptedException, NotSupportedException, SystemException {
try {
beginTransaction( session );

Expand All @@ -162,7 +165,7 @@ private void loadList(List<I> listIds, SessionImplementor session, PojoIndexer i
}
}

private void beginTransaction(Session session) throws Exception {
private void beginTransaction(Session session) throws SystemException, NotSupportedException {
if ( transactionManager != null ) {
if ( transactionTimeout != null ) {
transactionManager.setTransactionTimeout( transactionTimeout );
Expand Down

0 comments on commit e928c0c

Please sign in to comment.