Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
No announcement yet.
JdbcCursorInputSource and OutOfMemoryErrorPage Title Module
It seems like there has to be some kind of setting in hibernate for this. With the jdbc version is changed the cursor to forward only from scroll sensitive. I'm assuming that hibernate must be using a scroll sensitive one as well. I'm not a hibernate expert, but it seems like there should be a way to control that.
You could also try using the normal DrivingQueryItemReader or JdbcCursorItemReader to grab the primary keys and use Hibernate in the Writer/Tranformer to load the object and do whatever is necessary in the context of a single commit interval.
Thanks for your answers, i will check if i can change the cursor to forward only.
To avoid those problems in future I implemented a DrivingHibernateCursorReader. The example the iBatis implemention gave to me was quite easy to transfer to hibernate. I'am now using a SingleColumn KeyGenerator that gets all keys via a JdbcTemplate. Then i chunk those in my DrivingItemReader and read with a statement like this: "select from Table where id < n+1000 and id > n" the read object chunks are then transfered into a queue from which the read method then reads the elements. An implementation where i just read one object for a key at a time performed to slow. Is this a good way to implement it? The performance decrease compared to the Cursor implementation is approx. at 15-20%.