ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: iBATIS insert does not execute
Date Sat, 19 Apr 2008 15:57:04 GMT
I don't understand what you're trying to do:

a) Do you want to get rid of the separate selectKey definition, if so,
b) What do you mean by the DTD is correct?
c) Integer id = (Integer) sqlMap.insert("statementId"); should just
plain work, if not, try debugging an insert by setting breakpoints in
SqlMapExecutorDelegate.insert() and
d) What does this have to do with transactions? Is it because the select
key query executes in a separate statement and you have auto-commit on?


-----Original Message-----
From: Chris Marshall [mailto:chris@campsbayterrace.com] 
Sent: Saturday, April 19, 2008 5:24 PM
To: user-java@ibatis.apache.org
Subject: Re: iBATIS insert does not execute

Thanks for your input Niels,
The DTD is correct and I have no problem with the return from
selectKey, but I would like to return the generated key to the
application as follows:

Integer id = (Integer) sqlMap.insert(".....&c);

by defining the insert xml as follows:

<insert id="insert" parameterClass="MyParameterClass"
.........&c including selectKey

The selectKey stanza works fine, but I would like to have the id in
the application before committing the transaction for various reasons
(mainly because nested transactions are not supported).

I have seen the example of this that I included in my previous post at:

Regards Chris

View raw message