0

最近在使用数据库 Oracle RAC 11g 的应用程序 JPA/Hibernate 中出现以下错误。

当我们的存储已满并且 DBA 需要关闭连接、终止活动会话或类似“连接关闭”之类的情况时发生此错误(现在我可以知道发生了什么,他被解雇了......)

javax.persistence.RollbackException: Error while commiting the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
at com.cgmp.ValePedagioSite.comprarViagemPorPlaca(ValePedagioSite.java:473)
at sun.reflect.GeneratedMethodAccessor1719.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
        (...)
Caused by: org.hibernate.exception.JDBCConnectionException: could not insert: [com.cgmp.model.entity.PedagioPracaViagem]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2295)
        (...)
Caused by: java.sql.SQLRecoverableException: Connection closed
at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3331)
at oracle.jdbc.driver.T2CConnection.prepareStatement(T2CConnection.java:47)
at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3232)
at oracle.jdbc.driver.T2CConnection.prepareStatement(T2CConnection.java:47)
at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)
        (...)

其他实体插入没有问题...

--- 已编辑 ---

更多信息

配置 c3p0

<Resource auth="Container"
description=""
driverClass="oracle.jdbc.driver.OracleDriver"
acquireIncrement="1"
initialPoolSize="5"
maxPoolSize="300"
minPoolSize="5"
maxIdleTime="600"
maxIdleTimeExcessConnections="300"
unreturnedConnectionTimeout="900"
numHelperThreads="20"
name=""
user=""
password=" "
factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
jdbcUrl="jdbc:oracle:oci:" />

与其他 DBA 交谈时,他说Oracle 的一个实例获得了完整的磁盘,并且此时创建了部分提交的寄存器,但他只是删除了跟踪文件,没有停止 db,也没有杀死任何会话。

4

1 回答 1

1

好吧,没有足够的信息可以肯定地说,但这听起来像是您所看到的未完成的事务处理。JDBC 规范在未完成事务的情况下应该发生什么问题上默默无闻。甲骨文是我所知道的唯一一家决定最好的行动方案是在这种情况下投入工作的供应商。

于 2012-05-31T05:49:09.413 回答