[BUG]Using Mybatis 3.4.5 for Oracle multiple update, database update success but mybatis get the “-1” result

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[BUG]Using Mybatis 3.4.5 for Oracle multiple update, database update success but mybatis get the “-1” result

Victor Lee
mybatis version:3.4.5
java version:1.8
oracle:11g   ojdbc7:12.1.0.2

i try to use:
<update id =".." parameterType="..">
begin
insert into ....;
update .. set ..;
update .. set ..;
end;
</update>

to execute multiple sql in one block.
And every sql execute success(i confirmed in database) but mybatis return -1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b2bd5bf8-dd8c-4b14-b87e-fb1aba058fcan%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: [BUG]Using Mybatis 3.4.5 for Oracle multiple update, database update success but mybatis get the “-1” result

Iwao AVE!
Hello Victor,

It's not a bug, the driver returns -1 from the `execute()` call.
What do you expect?
If you want to get the number of updated/inserted rows or generated keys, you need to execute each statement separately.

Regards,
Iwao


On Wed, Jan 20, 2021 at 7:59 PM Victor Lee <[hidden email]> wrote:
mybatis version:3.4.5
java version:1.8
oracle:11g   ojdbc7:12.1.0.2

i try to use:
<update id =".." parameterType="..">
begin
insert into ....;
update .. set ..;
update .. set ..;
end;
</update>

to execute multiple sql in one block.
And every sql execute success(i confirmed in database) but mybatis return -1.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b2bd5bf8-dd8c-4b14-b87e-fb1aba058fcan%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2TRF%3DtEiHGUpa1R2srMNC77PR2Q_iQzq1WWqoMLw-X0zg%40mail.gmail.com.