?

Log in

No account? Create an account
 
 
16 January 2006 @ 04:35 pm
Lesson for today  

"ResultSet can not re-read row data for column 1"

That was the error message from a query. I found NOTHING about this message from Microsoft, but eventually found this document about a problem with somebody else's software that was traced to brain-dead SQL Server behavior with respect to TEXT columns. SQL Server really wants you to query your columns in the order defined by the DBA, and throws a hissy fit if you try to do anything slightly different.

The table we are querying doesn't have a TEXT column, but it does have an IMAGE column, which is similar in a few ways (IMAGE is how Microsoft spells BLOB). Maybe...

We are using intermediate mapping files to create our SQL queries and abstract out the different parts of a query - field projection, filtering, and entity associations - into components reusable across different queries. I commented out the IMAGE field (didn't need it for THIS test query), and found that the error was taken care of.

Yep, that was it. SQL server throwing a little hissy fit because It can't figure out how to handle a request for Organization_ID, Organization_Name, Logo, Logo_Type, Plate_Review_Delay when the DBA defined Organization_ID, Organization_Name, Logo, Plate_Review_Delay, Logo_Type.

On the bright side, now that I have sorted this out in the mapping file, we shouldn't have this problem any more for any queries that hit this table. I'd hate to maintain a half-dozen distinct queries against the table when this kind of thing crops up. One more reason to love Hibernate.
 
 
 
Stupendous Manfarmalloc on January 17th, 2006 06:31 pm (UTC)
Yeah you will not hear any praises from me about SQL Sever.