Hi All,
I am using
Criteria.list() to fetch an instance from database. which works perfectly everytime as it is a general code of my application used to fetch instances based on criterias provided.
Also, i have set FlushMode = AUTO.
Code:
Session session = getSessionFactory().getCurrentSession();
session.setFlushMode(FlushMode.AUTO);
Scenario:I have populated a table in d current session and then trying to find an instance from the inserted data in that table. But i am not able to do this fetch operation as I am getting the following Exception.
Code:
java.lang.RuntimeException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
java.lang.RuntimeException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
It will be really great if anyone can literate me on this by providing any solution to this issue.
Or, is it an issue caused due to improper FlushMode?
Trace also says,
Code:
Caused by: java.sql.SQLException: ORA-01401: inserted value too large for column
But operation I am doing currently is fetchin an instance, so how issue with insertion has come? is it trying to settle previous operation, which was an insert operation before performing fetch operation??
Complete trace is provided below.
Trace:Code:
ReportPersistenceManagerThread java.lang.RuntimeException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
java.lang.RuntimeException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:266)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:238)
at com.novarum.nova.analytic.ResultDataFactory.find(ResultDataFactory.java:45)
at com.ebw.nova.util.ReportGenerator.saveReport(ReportGenerator.java:302)
at com.ebw.nova.util.ReportPersistenceManagerThread.run(ReportPersistenceManagerThread.java:64)
at com.novarum.nova.analytic.RiskBatchItem.runReportPerister(RiskBatchItem.java:252)
at com.novarum.nova.analytic.RiskBatchItem$Action.doAction(RiskBatchItem.java:212)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:45)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.novarum.nova.analytic.RiskBatchItem.run(RiskBatchItem.java:141)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1485)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at com.ebw.nova.server.entitybeanmgr.persistence.PersistenceManager.list(PersistenceManager.java:429)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:262)
... 11 more
Caused by: java.sql.SQLException: ORA-01401: inserted value too large for column
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2957)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2065)
... 23 more
getCause(): org.hibernate.exception.ConstraintViolationException: could not insert: [com.novarum.nova.bean.analytic.IRiskResultData]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1485)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at com.ebw.nova.server.entitybeanmgr.persistence.PersistenceManager.list(PersistenceManager.java:429)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:262)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:238)
at com.novarum.nova.analytic.ResultDataFactory.find(ResultDataFactory.java:45)
at com.ebw.nova.util.ReportGenerator.saveReport(ReportGenerator.java:302)
at com.ebw.nova.util.ReportPersistenceManagerThread.run(ReportPersistenceManagerThread.java:64)
at com.novarum.nova.analytic.RiskBatchItem.runReportPerister(RiskBatchItem.java:252)
at com.novarum.nova.analytic.RiskBatchItem$Action.doAction(RiskBatchItem.java:212)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:45)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.novarum.nova.analytic.RiskBatchItem.run(RiskBatchItem.java:141)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: ORA-01401: inserted value too large for column
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2957)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2065)
... 23 more
getSQLException(): java.sql.SQLException: ORA-01401: inserted value too large for column
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2957)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2065)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1485)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at com.ebw.nova.server.entitybeanmgr.persistence.PersistenceManager.list(PersistenceManager.java:429)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:262)
at com.ebw.nova.server.entitybeanmgr.PersistenceEntityBeanMgr.find(PersistenceEntityBeanMgr.java:238)
at com.novarum.nova.analytic.ResultDataFactory.find(ResultDataFactory.java:45)
at com.ebw.nova.util.ReportGenerator.saveReport(ReportGenerator.java:302)
at com.ebw.nova.util.ReportPersistenceManagerThread.run(ReportPersistenceManagerThread.java:64)
at com.novarum.nova.analytic.RiskBatchItem.runReportPerister(RiskBatchItem.java:252)
at com.novarum.nova.analytic.RiskBatchItem$Action.doAction(RiskBatchItem.java:212)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:45)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.novarum.nova.analytic.RiskBatchItem.run(RiskBatchItem.java:141)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
at java.lang.Thread.run(Thread.java:534)
Hibernate: update novarpt.FACT_RISK_BATCH_ITEM_RUN set RISK_BATCH_ITEM=?, RISK_SPEC=?, DO_HEDGE=?, SORT_INDEX=?, ERROR_DESC=?, RISK_RUN_KEY=?, ERROR_CODE=?, RISK_BATCH_ENV_ID=?, TIME_ID=? where RISK_BATCH_ITEM_RUN_ID=?
08/22/2007 09:28:28 [INFO] ReportPersistenceManagerThread Saved (05-Book Reval-02) for 10-Apr-06 in (686) secs
08/22/2007 09:28:32 [INFO] RiskBatchItem$Action ------ End Exec (05-Book Reval-02) in (736) Secs.
java.lang.RuntimeException: weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at com.novarum.nova.analytic.RiskBatchItem.run(RiskBatchItem.java:143)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
at java.lang.Thread.run(Thread.java:534)
Caused by: weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:27)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:53)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.novarum.nova.analytic.RiskBatchItem.run(RiskBatchItem.java:141)