[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 GitHub
parent 5565b3e80d
commit 92922b874c
2 changed files with 54 additions and 56 deletions

View File

@ -6,6 +6,9 @@ release, see :doc:`upgrade-notes`.
Unreleased
==========
* Fixed incorrect exception handling in ``NodeVaultService._query()``.
* Avoided a memory leak deriving from incorrect MappedSchema caching strategy.
* Added program line argument ``on-unknown-config-keys`` to allow specifying behaviour on unknown node configuration property keys.

View File

@ -406,7 +406,6 @@ class NodeVaultService(
// TODO: revisit (use single instance of parser for all queries)
val criteriaParser = HibernateQueryCriteriaParser(contractStateType, contractStateTypeMappings, criteriaBuilder, criteriaQuery, queryRootVaultStates)
try {
// parse criteria and build where predicates
criteriaParser.parse(criteria, sorting)
@ -461,10 +460,6 @@ class NodeVaultService(
statesAndRefs.addAll(servicesForResolution.loadStates(stateRefs) as Collection<StateAndRef<T>>)
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)