Merge pull request #3189 from corda/cherrypick-corda-1397

CORDA-1397 - Fixed incorrect exception handling in `NodeVaultService…
This commit is contained in:
Katelyn Baker 2018-05-18 14:29:02 +01:00 committed by GitHub
commit 35246460e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)