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

61 views
Skip to first unread message

Victor Lee

unread,
Jan 20, 2021, 5:59:35 AM1/20/21
to mybatis-user
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.

Iwao AVE!

unread,
Jan 28, 2021, 12:41:09 PM1/28/21
to mybatis-user
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


--
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 mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b2bd5bf8-dd8c-4b14-b87e-fb1aba058fcan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages