Issue #2645 Prevent the recurring time in SubscriptionNotifyTask from being killed by an exception

thrown from run.  Fix issue where the InMemoryBandwidthBucketAllocationAssociator was not updating the in memory allocation
when the db value status was updated.  Added RegistryBandwidthRecord to the list of classes to init by HibernateBandwidthDbInit.
Updates to hibernate.cfg.xml for Richard.

Change-Id: I0eb7b0a34e48f6b8db8065dee45966c48ef38617

Former-commit-id: c05358aac5 [formerly 02910c2a8c] [formerly 07a4420596] [formerly 12860c79f9 [formerly 07a4420596 [formerly e0dbe59a7dc418e3b8ed62396b6ef2047b5990fd]]]
Former-commit-id: 12860c79f9
Former-commit-id: 53dd09e9f01677738d8bb7bceaf559f45f59115c [formerly be6f12e9c2]
Former-commit-id: 5c85734e02
This commit is contained in:
Brad Gonzales 2014-01-08 13:14:40 -06:00
parent 5168eefb50
commit ad3da98af6
4 changed files with 13 additions and 2 deletions

View file

@ -62,7 +62,7 @@
<!-- Additional properties may be added to c3p0.properties -->
<property name="hibernate.c3p0.idle_test_period">60</property>
<property name="hibernate.c3p0.timeout">${db.metadata.pool.timeout}</property>
<property name="hibernate.c3p0.max_statements">10</property>
<property name="hibernate.c3p0.max_statements">${db.metadata.pool.max}</property>
<property name="hibernate.c3p0.acquire_increment">5</property>
<property name="hibernate.c3p0.min_size">${db.metadata.pool.min}</property>
<property name="hibernate.c3p0.max_size">${db.metadata.pool.max}</property>
@ -71,7 +71,7 @@
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.jdbc.use_streams_for_binary">false</property>
<property name="cache.use_query_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
</session-factory>
</hibernate-configuration>

View file

@ -44,6 +44,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.SubscriptionRetrievalAttr
* Apr 30, 2013 1960 djohnson Extend the generalized DbInit.
* Jun 24, 2013 2106 djohnson Add {@link BandwidthBucket} to annotated classes.
* Jul 11, 2013 2106 djohnson Add {@link SubscriptionRetrievalAttributes}.
* Jan 08, 2013 2645 bgonzale Added RegistryBandwidthRecord to configuration annotated class list.
* </pre>
*
* @author jspinks
@ -82,6 +83,7 @@ public class HibernateBandwidthDbInit extends DbInit implements
aConfig.addAnnotatedClass(com.raytheon.uf.edex.datadelivery.bandwidth.dao.SubscriptionRetrieval.class);
aConfig.addAnnotatedClass(com.raytheon.uf.edex.datadelivery.bandwidth.dao.BandwidthAllocation.class);
aConfig.addAnnotatedClass(com.raytheon.uf.edex.datadelivery.bandwidth.dao.SubscriptionRetrievalAttributes.class);
aConfig.addAnnotatedClass(com.raytheon.uf.edex.datadelivery.bandwidth.registry.RegistryBandwidthRecord.class);
return aConfig;
}

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDao;
* Jun 25, 2013 2106 djohnson Extracted from {@link BandwidthBucket} and {@link RetrievalPlan}.
* Dec 17, 2013 2636 bgonzale Prevent stale BandwidthAllocation updates by retrieving
* them from the dao before updating.
* Jan 08, 2013 2645 bgonzale Update allocations in the multimap when setting status to PROCESSING.
*
* </pre>
*
@ -146,6 +147,8 @@ public class InMemoryBandwidthBucketAllocationAssociator implements
// mapping
allocations.remove(o.getId(), o);
} else {
// update it
allocation = o;
allocation.setStatus(RetrievalStatus.PROCESSING);
bandwidthDao.createOrUpdate(allocation);
}

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
* Nov 25, 2012 1268 dhladky Added additional fields to process subscription tracking
* Feb 05, 2013 1580 mpduff EventBus refactor.
* Mar 05, 2013 1647 djohnson Debug log running message.
* Jan 08, 2013 2645 bgonzale Catch all exceptions in run to prevent the recurring timer from failing.
*
* </pre>
*
@ -325,6 +326,11 @@ public class SubscriptionNotifyTask implements Runnable {
} catch (DataAccessLayerException e) {
statusHandler.handle(Priority.ERROR,
"Unable to contact the database", e);
} catch (Exception e) {
statusHandler
.handle(Priority.ERROR,
"Unexpected error during Subscription Notify Task processing...",
e);
}
}
}