I have a query which generates a fairly large XML document (~30k) as a query column for each record of a large table, of the form...
SELECT recordKey, lastUpdatedDate, ( SELECT ... FOR XML PATH( 'elemName' ), TYPE )
FROM largeTable
ORDER BY lastUpdateDate
If I run this query from SQLServer management studio, the query returns almost instantly, showing the first rows, as I would expect, and continues to run in the background.
However, when I run this query from the Camel JDBC component in StreamList mode, it appears to cache the entire resultset at the point of querying, which means I run out of memory.
I've checked the JDBC driver properties, and explicitly set the responseBuffering
property to adaptive
, and have also tried setting the selectMethod
to cursor
, neither of which appear to make any difference to my query.
Is this a characteristic of querying XML with JDBC, or are there some parameters I need to set differently?