Issue Details (XML | Word | Printable)

Key: BATCH-577
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Robert Kasanicky
Reporter: Robert Kasanicky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

JdbcCursorItemReader doesn't work with Derby

Created: 11/Apr/08 07:13 AM   Updated: 07/Aug/08 10:07 AM
Component/s: Infrastructure
Affects Version/s: 1.0.0
Fix Version/s: 1.0.1

Time Tracking:
Original Estimate: 0.12d
Original Estimate - 0.12d
Remaining Estimate: 0.12d
Remaining Estimate - 0.12d
Time Spent: Not Specified
Remaining Estimate - 0.12d


 Description  « Hide
Using embedded Derby driver:

java.sql.SQLException: The 'getRow()' method is only allowed on scroll cursors.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.checkScrollCursor(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getRow(Unknown Source)
at org.apache.commons.dbcp.DelegatingResultSet.getRow(DelegatingResultSet.java:331)
at org.springframework.batch.item.database.JdbcCursorItemReader$BufferredResultSetReader.read(JdbcCursorItemReader.java:475)


 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky added a comment - 14/Apr/08 05:32 AM
I don't see how to solve this in a fully satisfactory way - all I could think of so far is isolating the 'getRow()' call as it seems essential only for verifying the cursor position has not been manipulated outside the reader (in the RowMapper). Then JdbcCursorItemReader would work with Derby as long as verifyCursorPosition=false (however default is true).

Dave Syer added a comment - 15/Apr/08 04:06 PM
Sound like a reasonable compromise. Or maybe we could catch the exception and forward to the user with a message about the platform? Derby isn't that common.

Robert Kasanicky added a comment - 17/Apr/08 04:30 AM
isolated the problematic ResultSet#getRow() call to be used only for cursor position verification and added javadoc to disable the verification when used with Derby.

Dave Syer added a comment - 07/Aug/08 10:07 AM
Assume closed as resolved and released