Experiencing issue wherein there is lag in db commit

23 views
Skip to first unread message

Santosh Tripathi

unread,
Jan 8, 2020, 8:35:24 PM1/8/20
to mybatis-user
We are experiencing issue wherein there is lag in db commit although the following statements after the Ibatis insert has been executed.
Unable to fetch the record inserted in a separate resulting in Record not found for few cases due to this issue.
Anyone familiar with this kind of issue and what could be done to mitigate it.

Mark Nolan

unread,
Jan 8, 2020, 9:02:53 PM1/8/20
to mybati...@googlegroups.com
You don't give much detail!

Which db engine? How are you managing transactions (what causes the commit)? When you say "statements after the insert", do you mean Java statements or SQL statements?

.

--
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/0cd213b1-457a-4b0b-91c7-40554850f6ef%40googlegroups.com.

Santosh Tripathi

unread,
Jan 8, 2020, 10:48:12 PM1/8/20
to mybatis-user
Hi Mark,
Let me provide the details .Statements after the insert are Java statements execute.
Also the db fetch is a separate session alltogether.
We are using Oracle as the database.
Transaction managed through org.springframework.jdbc.datasource.DataSourceTransactionManager and Apache Commons DBCP connection pool as the connectionpool.

Regards,
Santosh


On Wednesday, January 8, 2020 at 6:02:53 PM UTC-8, Mark Nolan wrote:
You don't give much detail!

Which db engine? How are you managing transactions (what causes the commit)? When you say "statements after the insert", do you mean Java statements or SQL statements?

.

On Thu, 9 Jan 2020, 01:35 Santosh Tripathi, <santo...@gmail.com> wrote:
We are experiencing issue wherein there is lag in db commit although the following statements after the Ibatis insert has been executed.
Unable to fetch the record inserted in a separate resulting in Record not found for few cases due to this issue.
Anyone familiar with this kind of issue and what could be done to mitigate it.

--
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 mybati...@googlegroups.com.

Mark Nolan

unread,
Jan 9, 2020, 1:12:20 PM1/9/20
to mybati...@googlegroups.com

Are you using annotated transactions (@Transaction)? Is the extra Java code that is executed in the same method as the SQL and is that method annotated with @Transaction?
.


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/85f23f57-48c2-44d5-b0ab-a81f6749e7d9%40googlegroups.com.

Santosh Tripathi

unread,
Jan 9, 2020, 8:07:29 PM1/9/20
to mybatis-user
No, the java code is separate from the transaction method and not part of the same method as the SQL.

晴天的小猪

unread,
Jan 10, 2020, 6:58:27 PM1/10/20
to mybatis-user

I posted two posts on Google forums, but they disappeared after refreshing, I can only try to send email directly, excuse me.


Basic Information :

  1. mybatis version : 3.3.0
  2. oracle version : 11.2.0.4
  3. java version : 1.8.0_72
  4. ojdbc version : 6-11.2.0.3


Phenomenon :

Occasionally, ClassCastException is reported. See the attachment for the contents of the exception. After checking the logic, no exception is found. On another server, the same code, ojdbc version is 7, there is no similar error.

For some reason, we are unable to upgrade the ojdbc version at this time. Have you encountered similar problems? Are you willing to help me find the cause? Thank you.

晴天的小猪

unread,
Jan 10, 2020, 6:58:28 PM1/10/20
to mybatis-user
error.log
error2.log

Iwao AVE!

unread,
Jan 14, 2020, 10:01:02 AM1/14/20
to mybatis-user
Hi Yina,

Looking at the stack trace, it seems like a driver issue.
I don't have any advice other than to upgrade the driver, unfortunately.

Regards,
Iwao


On Sat, Jan 11, 2020 at 8:58 AM yina Zhu <1237...@qq.com> wrote:

Basic Information :

  1. mybatis version : 3.3.0
  2. oracle version : 11.2.0.4
  3. java version : 1.8.0_72
  4. ojdbc version : 6-11.2.0.3


Phenomenon :

Occasionally, ClassCastException is reported. See the attachment for the contents of the exception. After checking the logic, no exception is found. On another server, the same code, ojdbc version is 7, there is no similar error.

For some reason, we are unable to upgrade the ojdbc version at this time. Have you encountered similar problems? Are you willing to help me find the cause? Thank you.

--
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/c26dc42d-3abc-4096-aac8-01752a35df7a%40googlegroups.com.

Debell Anthony

unread,
Jan 14, 2020, 7:38:00 PM1/14/20
to mybati...@googlegroups.com
你这SQL完全没必要这没写~  最好能把你的xml文件及mapper定义接口发一下

晴天的小猪 <1237...@qq.com> 于2020年1月11日周六 上午7:58写道:
--
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.

yina Zhu

unread,
Jan 14, 2020, 10:06:54 PM1/14/20
to mybatis-user
mapper肯定没问题,这个sql执行了好几年了

<sql id="getPoById">
select o.* from
<include refid="tableSection" />
o
where o.ID = #{id,jdbcType=DECIMAL}
</sql>


在 2020年1月15日星期三 UTC+8上午8:38:00,Debell Anthony写道:
你这SQL完全没必要这没写~  最好能把你的xml文件及mapper定义接口发一下

晴天的小猪 <1237...@qq.com> 于2020年1月11日周六 上午7:58写道:

I posted two posts on Google forums, but they disappeared after refreshing, I can only try to send email directly, excuse me.


Basic Information :

  1. mybatis version : 3.3.0
  2. oracle version : 11.2.0.4
  3. java version : 1.8.0_72
  4. ojdbc version : 6-11.2.0.3


Phenomenon :

Occasionally, ClassCastException is reported. See the attachment for the contents of the exception. After checking the logic, no exception is found. On another server, the same code, ojdbc version is 7, there is no similar error.

For some reason, we are unable to upgrade the ojdbc version at this time. Have you encountered similar problems? Are you willing to help me find the cause? Thank you.

--
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 mybati...@googlegroups.com.

Debell Anthony

unread,
Jan 16, 2020, 7:01:30 AM1/16/20
to mybati...@googlegroups.com
Error querying database.  Cause: java.lang.ClassCastException: [B cannot be cast to [C
---------------------
[B ----> Byte
[C ---> Char

你看下是不是数据类型有什么不匹配?(比如传值类型或者主键赋值错误?)

yina Zhu <1237...@qq.com> 于2020年1月15日周三 上午11:06写道:
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/ab41f47d-a01e-4879-94d9-0195fe06b255%40googlegroups.com.

晴天的小猪

unread,
Jan 16, 2020, 7:57:56 AM1/16/20
to mybatis-user
真不是

---Original---
From: "Debell Anthony"<cty...@gmail.com>
Date: Thu, Jan 16, 2020 20:01 PM
To: "mybatis-user"<mybati...@googlegroups.com>;
Subject: Re: Help, weird ClassCastException crash me

Iwao AVE!

unread,
Jan 16, 2020, 6:24:56 PM1/16/20
to mybatis-user
Hi Santosh,

This could happen when the transaction isolation level is READ ONLY.
You should read the entire post, but here is the relevant sentence:

> A READ ONLY transaction is equivalent to a REPEATABLE READ or SERIALIZABLE transaction that cannot perform any modifications in SQL. A transaction using a READ ONLY isolation level sees only those changes that were committed at the time the transaction began .

If this is the case, changing the isolation level to READ COMMITTED may resolve the issue.
Of course, the transaction inserted the row must be committed before executing select.

If it didn't help, please try creating a small executable project replicating the issue.
We may need to see the code and the configuration related to the series of operations.

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.
Reply all
Reply to author
Forward
0 new messages