ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Leyba" <xle...@gmail.com>
Subject Re: MySQL query problem
Date Fri, 20 Oct 2006 10:57:19 GMT
I guess my problem could be originated in the commit.

I mean I'm doing an insert, then I call a rowcount and then the
transcation is commited.

--------------
sqlMap = NotificationsSqlConfig.getSqlMapInstance();
session = sqlMap.openSession();
session.startTransaction();
						
sqlMap.insert("insertTopic", topicBean);

gr = (GenericResult) sqlMap.queryForObject("operationResult");

session.commitTransaction();
------------


If this is the case, how could I solve it ?

Thanks in advance

J
			

On 10/20/06, Javier Leyba <xleyba@gmail.com> wrote:
> On 10/20/06, jamesst <s.james@logicacmg.com> wrote:
> > When i tried executing more than one statement with MySQL in a <insert>
> > or <select> tag it has never worked but i am using 1.4 so things may
> > have changed.
> > so try removing SELECT ROW_COUNT() AS result. Maybe use a SelectKey may
> > work.
> >
> > <selectKey resultClass="int" >
> > select ROW_COUNT() ;
> > </selectKey>
> >
>
> Thanks for all replies.
>
> I did recommended changes but now I receive a -1 as row_count....
>
> I wonder how you all test a result of an insert to be sure it worked...
>
> Thanks in advance
>
> J
>


-- 
Javier Leyba
Barcelona - Spain
http://blog.leyba.com.ar

Mime
View raw message