robinson.L
robinson.L

Reputation: 83

spring batch about JdbcCursorItemReader

I have got a problem when I use JdbcCursorItemReader

org.springframework.dao.InvalidDataAccessResourceUsageException: Unexpected cursor position change

I've set dataSource, sql ,rowmapper,fetchsize ..

and also did not use multithread, anyone helps me?

Upvotes: 0

Views: 4334

Answers (2)

Mehdi
Mehdi

Reputation: 1477

Try to disable verifyCursorPosition property. Check if ti does meet your requirments as this parameter allows verification of cursor position after current row is processed by RowMapper or RowCallbackHandler when activated. You did not post any code. Here an example using jdbccursoritemreader.

Upvotes: 1

Michael Minella
Michael Minella

Reputation: 21463

As the post that bellabax points out, this exception is thrown when the RowMapper manipulates the cursor position. This occurs because of the way restart processing is set up. On restart, we skip to the last record that was processed. If the cursor is moved without the framework knowing, we'll restart in the wrong position.

Upvotes: 0

Related Questions