You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by patelp7 <pr...@optimalstrategix.com> on 2016/05/23 16:01:03 UTC

camel-jdbc fetchSize out of memory error

I am trying to ingest data from postgres to another DB and I am using
camel-jdbc component to do it. I have a large table so I want to read few
rows at a time instead of the whole table altogether. so my route looks like
below (only for testing purpose)
from(fromUri).setBody("select * from 
 limit
10").to("jdbc://myDataSource?resetAutoCommit=false&statement.fetchSize=2").split(body()).streaming().process(test)

As shown above, I am only getting 10 rows at a time for testing purpose and
I have set fetchSize to 2 to only receive 2 rows at a time. However, I am
still receiving all 10 rows altogether. When I remove the "limit 10" from
the query I get Out of Memory error just before the split command which
tells me that its trying to load the entire result set in memory.

What am I missing here or what am I doing wrong? 

Thanks for help.



--
View this message in context: http://camel.465427.n5.nabble.com/camel-jdbc-fetchSize-out-of-memory-error-tp5782974.html
Sent from the Camel - Users mailing list archive at Nabble.com.