ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesst <s.ja...@logicacmg.com>
Subject Re: MySQL query problem
Date Fri, 20 Oct 2006 12:54:37 GMT
make sure you have an endTransaction(); That is what really does the  
commit this should be done in the finally clause unless you have auto 
commit true..

Javier Leyba wrote:
> 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
>>
>
>



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

Mime
View raw message