ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: update() accepts <insert>?
Date Wed, 26 Oct 2005 17:25:10 GMT
Yes, ibatis allows you to call inserts or updates regardless of the XML
element used...the primary reason is that some people need to call update()
on selects.....

Consider them separate intentions. One is a descriptive XML document synax,
the other is a descriptive Java syntax....even if they may not match.


On 10/23/05, Zsolt <zkoppanylist@intland.com> wrote:
> Hi!
> Today we found a strange problem: our <selectKey> stanza embedded in an
> <insert> was simply ignored by iBATIS: the INSERT statement did run, but
> after that nothing happened -> the SELECT LAST_INSERT_ID() did not appear
> in
> the log and iBATIS didn't give any error msg, either.
> Finally we found that by accident we used the
> sqlMap.update() and not create() to invoke the SQL fragment, which was
> actually an <insert>.
> So it was our fault.
> But is this the desired behaviour that .update() accepts also <insert>
> fragments without any warning?
> IMHO it might be a good idea to throw some kind a exception in this case.
> Zsolt

View raw message