hibernate连接DB2报下面异常,虽然不影响次昂程序运行,但是还是希望能够消除这个警告信息,请高人指点,小弟非常感谢!

ipv6_hong 2007-12-25 05:12:31
2007-12-25 17:00:31,328 INFO [org.springframework.jdbc.datasource.JdbcTransactio
nObjectSupport] - <JDBC 3.0 Savepoint class is available>
2007-12-25 17:00:31,453 INFO [org.springframework.beans.factory.xml.XmlBeanDefin
itionReader] - <Loading XML bean definitions from class path resource [org/sprin
gframework/jdbc/support/sql-error-codes.xml]>
2007-12-25 17:00:31,468 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'DB2'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'HSQL'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'MS-SQL'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'MySQL'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'Oracle'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'Informix'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'PostgreSQL'>
2007-12-25 17:00:31,484 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - <Creating shared instance of singleton bean 'Sybase'>
2007-12-25 17:00:31,484 INFO [org.springframework.jdbc.support.SQLErrorCodesFact
ory] - <SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, Postg
reSQL, Sybase]>
Hibernate: select webxxlm0_.LMID as LMID25_, webxxlm0_.LMMC as LMMC25_, webxxlm0
_.LMMS as LMMS25_, webxxlm0_.ZT as ZT25_, webxxlm0_.LMSX as LMSX25_ from WEB_XXL
M webxxlm0_ where 1=1 and webxxlm0_.ZT='1' order by webxxlm0_.LMSX
2007-12-25 17:00:32,390 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,390 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16dfbc050116d632ca360004'
2007-12-25 17:00:32,437 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,437 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16db06200116db84cfa40001'
2007-12-25 17:00:32,453 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,453 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16db06200116db852e7d0003'
2007-12-25 17:00:32,468 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,468 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16dfbc050116d632467f0002'
2007-12-25 17:00:32,484 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,484 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16dfbc050116d632b0c20003'
2007-12-25 17:00:32,484 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,484 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab170fa66401170fae7eda0001'
2007-12-25 17:00:32,500 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,500 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
Hibernate: select count(*) as col_0_0_ from WEB_FBXXB webfbxxb0_ where webfbxxb0
_.LMID='40288aab16dfbc050116d63429580007'
2007-12-25 17:00:32,515 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL W
arning: 0, SQLState: null>
2007-12-25 17:00:32,515 WARN [org.hibernate.util.JDBCExceptionReporter] - <[ibm]
[db2][jcc][10217][10310] 已经建立连接之后未强制实施连接只读方式。
要强制实施只读连接,应设置只读数据源或连接属性。>
2007-12-25 17:04:35,234 ERROR [com.synjones.transfer.service.schedule.HandleAppe
nder] - <192.168.10.140机器连接错误,网络存在故障!>
2007-12-25 17:09:35,218 ERROR [com.synjones.transfer.service.schedule.HandleAppe
nder] - <192.168.10.140机器连接错误,网络存在故障!>
...全文
1794 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wcl_friend 2012-09-10
  • 打赏
  • 举报
回复
学习中,想知道是什么情况,望楼主解决了分享下经验
a409693932 2012-03-31
  • 打赏
  • 举报
回复
是因为DB2不支持只读的事务
vikenpeng 2010-01-13
  • 打赏
  • 举报
回复
将spring 的事务特性read_only改为false即可
CoffeeBubble 2008-06-25
  • 打赏
  • 举报
回复
今天刚遇到的这个问题,怎么网络上找不到相关的解决方式呀..

有没有解决问题呢
meiZiNick 2008-05-01
  • 打赏
  • 举报
回复
等待牛人来答.
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
关注 接分
cmk2005 2008-04-15
  • 打赏
  • 举报
回复 1
http://forum.springframework.org/showthread.php?t=12637

Well, the read-only flag is a kind of stepchild in the JDBC spec... Many drivers (and DBMS) don't really support a true read-only transaction. Some do optimize transaction processing, though, so setting the readOnly flag is nevertheless usually worth it.

In your case, the driver simply isn't able to switch the connection to true read-only mode and logs a corresponding warning. This can safely be ignored; your transaction won't get read-only optimizations, but that doesn't hurt.

You could remove the "readOnly" marker from your transaction attribute to avoid the warning. However, "readOnly" also triggers other optimizations, for example it suppresses Hibernate flush attempts for read-only operations, so I recommend to keep those markers and simply ignore the warnings.

Juergen
ipv6_hong 2008-02-05
  • 打赏
  • 举报
回复
怎么没人回答啊?

24,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧