Hi, I've been using Ibatis2 for the last couple of years - great job, and thanks.

I'm now trying out Ibatis3 and have seen the following behavior:

When I call a selectList query with a ResultMapper it works, but when I call it with an SQLSession that has already called this query without a ResultMapper it doesn't. It looks like the sql-session is caching the default result-mapper on the first call and then ignoring the passed result-mapper on the second call.

I can work around this by using different sql-sessions, but thought you might like to know as it had me confused for a time. If this is correct behavior then it might be as well to throw an exception when the second call with a ResultMapper is executed to tell the user this sql-session already has a mapper. Alternatively, on the calls with a passed result-mapper, you may be able to keep the original result-mapper in a local variable, overwrite this default with the passed value, perform the query, then restore the original result-mapper. That way multiple calls with/without result-mappers would continue to work as expected from a single sql-session?

regards...
Roy


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to