Calling mysql stored procedure with iBatis

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Calling mysql stored procedure with iBatis

akhilachuthan
This post has NOT been accepted by the mailing list yet.
My application used Spring MVC+iBatis+JBoss7+MySQL. I have a stored procedure in mySQL, i mapped it in my iBatis mapper.xml file and call it via my sqlMapClient from my DAO. I make a call to my dao method with a  parameter (say a) from my test or application, I get a proper response. I make a call to my dao method with another parameter (say b) from my test or application, I get a proper response. Now i make two calls to the same dao method within my test method, and  pass 'a' as param in the first call and param 'b' in the second call, I always get the value for parameter 'a' for both the calls.

This looks strange. Why am i getting the result for my first call in all the subsequent calls that i make with different paramters..

For information I am using a HashMap as my resultclass in my mapper.xml. This returns me a list of hashmaps in my dao..

Thanks in advance
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling mysql stored procedure with iBatis

akhilachuthan
This post has NOT been accepted by the mailing list yet.
Fixed it. Have to set the property remapResults="true" in mapper.xml

Eg

<select id="myReport" parameterClass="Map" resultClass="java.util.LinkedHashMap" remapResults="true">
                CALL PROCEDURE_NAME(#user#,#startDate#, #endDate#,#timeCategory#);
        </select>
Loading...