nilesh - 2004-11-24

I created a generic SQL Map like below. I get a SQL stmt from somewhere and trying to use iBatis SQLMap just to execute the SQL. I'll provide the complete select stmt.

<select id="custom_sqlstmt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">

    $custom_sql$

</select>

First call goes thro and comes back with proper results. But when I try to execute a different SQL using this same SQL Map, it gives me some mapping exceptions. Looking at the exception, all I can think of is that, sql map internally keeps the resultset metadata's structure somewhere in the cache and use the same information again for the subsequent sql calls. In above case, since I provide a different SQL stmt each time, resultset metadata would be different per call. And as a result, when sqlmap tries to map the result using old structure, it throws mapping exceptions.

Is there any work around to resolve this issue? Thanks in advance for your help!

- Nilesh -