Bit afraid to answer because I'm also quite new to this.
It sounds right to me that it can't do the auto-result map to the existing
class property if you are not selecting the matching column.


MEINDERT HOVING
Developer, Pastel Payroll
 
Direct:
+27 (21) 680 9015
Main:
+27 (21) 680 9000
Fax:
+27 (21) 680 9090
[EMAIL PROTECTED]
www.pastel.co.za
 
9 out of 10 accountants recommend PASTEL Accounting

-----Original Message-----
From: Vamsee Kanakala [mailto:[EMAIL PROTECTED] 
Sent: 12 July 2005 09:15 AM
To: [email protected]
Subject: Result map problems...

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.

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.12/46 - Release Date: 11/07/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.12/46 - Release Date: 11/07/2005
 

Reply via email to