首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

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

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

hibernate连接DB2报下面异常,虽然不影响次昂程序运行,但是还是希望能够消除这个警告信息,请高人指点,小弟非常感谢!
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机器连接错误,网络存在故障!>


[解决办法]
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
[解决办法]
关注 接分
[解决办法]
等待牛人来答.

热点排行