What version of iBATIS are you using? What version of Oracle? How is
your Java mapper function defined?
--
Guy Rouillier
And from the original question list: How is your Java mapper function
defined?
--
Guy Rouillier
Yes. I've not done it this way, but I don't see why it shouldn't work.
Can you try this using mappers instead? See the section "Using
Mappers" in the documentation. I use those exclusively and they provide
accurate counts.
Your return values look like a 2's complement number. I wonder if
Oracle is returning a long and iBATIS is doing an erroneous conversion
to int.
>
>
> On Jun 15, 1:27 pm, Guy Rouillier<g...@burntmail.com> wrote:
>> On 6/15/2010 8:13 AM, q111111 wrote:
>>
>>>> What version of iBATIS are you using? What version of Oracle? How is
>>>> your Java mapper function defined?
>>
>>> MyBatis 3.0.1
>>> Oracle 10g
>>> Mapper file:
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>> <!DOCTYPE mapper
>>> PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
>>> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
>>> <mapper namespace="my.path">
>>> <delete id="delete"
>>> delete from MyTable
>>> </delete>
>>> </mapper>
>>
>> And from the original question list: How is your Java mapper function
>> defined?
>>
>> --
>> Guy Rouillier
>
--
Guy Rouillier
That shouldn't be necessary. I just did a quick test, also using Oracle
10g, starting with your code:
XML:
<delete id="delete">
delete from test
</delete>
BTW, the code you posted was missing the closing angle bracket on the
first line. I assume that was just a copy and paste error on your part;
iBATIS threw a read error exception without it.
mapper.java:
int delete();
main.java:
int iRows = mapper.delete();
log.info("Number of rows deleted: " + iRows);
session.commit();
Prints "Number of rows deleted: 30", which is the number of rows in my
test table.
I'm using JDK 1.6.0_16 on Windows. The only other thing I see is that
you are not printing out the rows deleted immediately after invocation,
but are instead returning the value. Print out the value immediately
after invocation, as I've done. Maybe the issue is in the calling
routine and not in the iBATIS invocation.
--
Guy Rouillier
Are you using ojdbc6.jar from 11g? Make sure no other Oracle JARs exist
on your classpath.
--
Guy Rouillier
Can't be, or everyone would be getting an invalid rowcount, and you
would have heard about it long before now.
--
Guy Rouillier
--
Sent from my mobile device
public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
The default value to be returned with BATCH is the number reported, as seen here.Also, the default mode is not BATCH afaik.The real failure is in docs. They should state it.
Hi, I just wanted to confirm that the odd problem with magical number -2147482646 was observed and fixed by switching from BATCH to SIMPLE on the following env:java version "1.7.0_11"Java(TM) SE Runtime Environment (build 1.7.0_11-b21)Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)Personal Oracle Database 11g Release 11.2.0.1.0 - 64bit ProductionJDBC: ojdbc6 11.2.0.1.0
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/5fc5c825-aa0f-4a74-aae3-6181957983a8%40googlegroups.com.