首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

c3p0.max_statements = 零 GooGooStatementCache Problem with checked-in Statement

2012-08-21 
c3p0.max_statements 0 GooGooStatementCache Problem with checked-in Statement,testConnectionOnChec

c3p0.max_statements = 0 GooGooStatementCache Problem with checked-in Statement,
testConnectionOnCheckout = true

===================================

1、org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed.

问题:hibernate3默认的lazy为true,使用代理模式proxy属性允许延迟加载类的持久化实例。调用session.load()方法,Hibernate开始会返回CGLIB代理,除主键外的其他值均为null。当代理的某个方法被实际调用的时候, 真实的持久化对象才会被装载,但必须在同一个session中。如session.close()前一直未调用方法,close()后再调用,报上述错误。

解决:a.hbm.xml中 class项,加上lazy=false

???????????? b.使用session.get()方法,将不延迟,直接取出对象实例。

2、java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.

问题:ms SQLserver在设置为autoCommit=false,SelectMethod=direct时,处理多个statement将报该错

解决:在url加上设置SelectMethod=Cursor

3、java.lang.NullPointerException: Problem with checked-in Statement, discarding.

问题:oracle9i前的jdbc Driver有bug,多个statement亦会出错

解决:在http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html上下载最新的ojdbc14.jar,版本为10.2.0.1.0

?

热点排行