We have a problem with the Microsoft JDBC driver throwing a "ResultSet can not re-read row data for column 51." exception. We have discovered that it only appears if the resultset contains a NTEXT, TEXT or IMAGE column. The driver then imposes the limitation that columns must be read in increasing column indexes and that they may not be re-read. This limitation is permitted by the JDBC spec:
Quote:
For maximum portability, columns within a row should be read
in left-to-right order, and each column should only be read once. This
reflects implementation limitations in some underlying database protocols
However, Hibernate uses column names instead of indexes and loads then in whatever order it wants to load the data in from the ResultSet, versus left to right order.
Additionally, I had this same problem in 2.0.3, however I was able just to reimplement the Subclass class since it was getting the order of columns to load by first loading the subclass and then the super class. By swapping them, it worked:
Code:
public Iterator getPropertyClosureIterator() {
return new JoinedIterator( new Iterator[] {
getSuperclass().getPropertyClosureIterator(),
getPropertyIterator()
}
);
}
Unfortunantly the same swap doesn't work for 2.1.1. I tried downloading the snapshot from last night but no joy.
Any ideas on strategies to take?
Eric