My application used Spring MVC+iBatis+JBoss7+MySQL. I have a stored procedure in mySQL, mapped it in my iBatis mapper.xml file and calling it via my sqlMapClient from my DAO. If i execute the dao method once it works fine, but if i execute two calls to the same method with different stored procedure parameters(change in parameter means change in the result columns in my stored procedure), I get an exception that says my sql gramer is wrong. Looking at the logs i find that iBatis is trying to map my first query columns (result of my initial method call) to my result map. I even tried printing the hashcode of my dao class instance and they are different. Why is this happening when the procedure executes just fine when tried from DB clients like DbVislaulizer
For information I am using a HashMap as my resultclass in my mapper.xml. This returns me a list of linkedhashmaps in my dao..
Any help would be really handy.
Thanks in advance
Fixed it. Have to set the property remapResults="true" in mapper.xml
Eg
select id="myReport" parameterClass="Map" resultClass="java.util.LinkedHashMap" remapResults="true"