This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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%.