[CORDA-1397]: Fixed incorrect exception handling in NodeVaultService._query(). (#3043)

This commit is contained in:
Michele Sollecito 2018-05-01 19:33:13 +07:00 committed by Katelyn Baker
parent 1b214e00c1
commit 1700d30bc7
2 changed files with 55 additions and 56 deletions

View File

@ -7,6 +7,10 @@ release, see :doc:`upgrade-notes`.
Unreleased Unreleased
========== ==========
* Fixed incorrect exception handling in ``NodeVaultService._query()``.
* Avoided a memory leak deriving from incorrect MappedSchema caching strategy.
* Fix CORDA-1403 where a property of a class that implemented a generic interface could not be deserialised in * Fix CORDA-1403 where a property of a class that implemented a generic interface could not be deserialised in
a factory without a serialiser as the subtype check for the class instance failed. Fix is to compare the raw a factory without a serialiser as the subtype check for the class instance failed. Fix is to compare the raw
type. type.

View File

@ -396,7 +396,6 @@ class NodeVaultService(
// TODO: revisit (use single instance of parser for all queries) // TODO: revisit (use single instance of parser for all queries)
val criteriaParser = HibernateQueryCriteriaParser(contractStateType, contractStateTypeMappings, criteriaBuilder, criteriaQuery, queryRootVaultStates) val criteriaParser = HibernateQueryCriteriaParser(contractStateType, contractStateTypeMappings, criteriaBuilder, criteriaQuery, queryRootVaultStates)
try {
// parse criteria and build where predicates // parse criteria and build where predicates
criteriaParser.parse(criteria, sorting) criteriaParser.parse(criteria, sorting)
@ -451,10 +450,6 @@ class NodeVaultService(
statesAndRefs.addAll(servicesForResolution.loadStates(stateRefs) as Collection<StateAndRef<T>>) statesAndRefs.addAll(servicesForResolution.loadStates(stateRefs) as Collection<StateAndRef<T>>)
return Vault.Page(states = statesAndRefs, statesMetadata = statesMeta, stateTypes = criteriaParser.stateTypes, totalStatesAvailable = totalStates, otherResults = otherResults) return Vault.Page(states = statesAndRefs, statesMetadata = statesMeta, stateTypes = criteriaParser.stateTypes, totalStatesAvailable = totalStates, otherResults = otherResults)
} catch (e: java.lang.Exception) {
log.error(e.message)
throw e.cause ?: e
}
} }
@Throws(VaultQueryException::class) @Throws(VaultQueryException::class)