From 796c4dcf56a1aafc58773bedc82ddef5242a108c Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Thu, 13 Apr 2023 21:01:58 +0100 Subject: Remove 32K limit from queries with collection parameters SQL queries taking collection parameters currently create a seperate query parameter for each collection element. There is a limit of around 2^15 (32,768) query parameters. Postgres DB natively supports array types, in which the whole array is transmitted in binary as a single parameter. Changing queries to use arrays removes the 32K limit on queries. - Add support for Postgres arrays to queries - Change repository methods to use arrays, and provide overloaded versions taking collection parameters - Update tests to reflect 32K limit being lifted Issue-ID: CPS-1573 Signed-off-by: danielhanrahan Change-Id: I64f2aeaedbe54bfe12e3079cba0f2216759142c3 --- .../groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cps-ri/src/test/groovy') diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy index 9ef9732681..811c3290b9 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsModulePersistenceServiceSpec.groovy @@ -84,7 +84,7 @@ class CpsModulePersistenceServiceSpec extends Specification { def 'Store schema set error scenario: #scenario.'() { given: 'no yang resource are currently saved' - yangResourceRepositoryMock.findAllByChecksumIn(_) >> Collections.emptyList() + yangResourceRepositoryMock.findAllByChecksumIn(_ as Collection) >> Collections.emptyList() and: 'persisting yang resource raises db constraint exception (in case of concurrent requests for example)' yangResourceRepositoryMock.saveAll(_) >> { throw dbException } when: 'attempt to store schema set ' -- cgit 1.2.3-korg