Hi list,
I'm facing a strange problem. I have a pretty big query using a
lot of dynamic sql satements, like this:
http://rafb.net/paste/results/Glxoo380.html
This query basically selects a bunch of columns based on the parameters
passed. When I run this statement in isolation from a test, it works
flawlessly. I start up tomcat, and run it from the search page, it works
once or twice, and the next time it gives a nasty exception like this:
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation: encountered SQLException [
--- The error occurred in com/mafoi/assetregister/dao/Search.xml.
--- The error occurred while applying a result map.
--- Check the searchAssets-AutoResultMap.
--- Check the result mapping for the 'netbalance04' property.
--- Cause: org.postgresql.util.PSQLException: The column name netbalance04 not found.]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/mafoi/assetregister/dao/Search.xml.
--- The error occurred while applying a result map.
--- Check the searchAssets-AutoResultMap.
--- Check the result mapping for the 'netbalance04' property.
--- Cause: org.postgresql.util.PSQLException: The column name netbalance04 not found.
I know the error is self-explanatory, but the 'netbalance04' should not
even be selected in this query! Weird thing is that, it works when I run
the queries independently from a testcase. So I'm guessing that the
result map, which is a HashMap, is getting cached somewhere and ibatis
is trying to get the previous query's column names from the current
result set? It's just guess work, but I'm truly lost. Please help.
Regards,
Vamsee.