hello,
I have an exception that is only launched when a method is called for the first time, no exception is launched later.
This method is executed on every boot of my application :
Code:
public synchronized void updateTblOrder(Order order) {
// System.out.println("[Methode updateTblorder] - Thread : " + Thread.currentThread().getName());
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
session.beginTransaction();
Tblorder o = generateTBLOrder(order);
updateExecutqty(o, session); Ligne 897
if ( !isExist(o, session) ) {
session.save(o);
}
else {
List<Tblorder> result = session.createQuery("from Tblorder where order_id = '"+ o.getOrderId()+ "' ").list();
Tblorder tbl = result.get(0);
if ( tbl.getListOrderId() != null && !tbl.getListOrderId().equals(""))
o.setListOrderId(tbl.getListOrderId());
session.merge(o);
}
session.getTransaction().commit();
}
catch(Exception e) {
//session.beginTransaction().rollback();
session.getTransaction().rollback();
e.printStackTrace();
} finally{
if ( session != null && session.isOpen() )
session.close();
}
//}
}
Code:
public void updateExecutqty(Tblorder order, Session session) {
try
{
List<Tblorder> childListorder = session.createQuery("from Tblorder where order_listorderid = '"+ order.getOrderId()+ "' order by (order_id)").list(); Ligne 280
if ( childListorder != null ) {
//popupListOrderBean
if ( childListorder.size() > 0 ) {
order.setOrderExecqty(0.0);
}
for( int j=0 ; j<childListorder.size() ; j++ ) {
// On rajoute des childs
Tblorder childOrder = childListorder.get(j);
// update the execution qty of his parent
order.setOrderExecqty(order.getOrderExecqty() + childOrder.getOrderExecqty());
}
}
}
catch (Exception e) {
e.printStackTrace();
}
}
the stacktrace
Code:
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2216)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.ullink.extranet.module.orderBookMonitoring.dao.orderBook.DaoOrderBookImpl.updateExecutqty(DaoOrderBookImpl.java:280)
at com.ullink.extranet.module.orderBookMonitoring.dao.orderBook.DaoOrderBookImpl.updateTblOrder(DaoOrderBookImpl.java:897)
at com.ullink.extranet.module.orderBookMonitoring.service.orderBook.ServiceOrderBookImpl.updateTblOrder(ServiceOrderBookImpl.java:399)
at com.ullink.extranet.module.orderBookMonitoring.odiSysConnection.threadPool.ThreadUpdateOrder.run(ThreadUpdateOrder.java:17)
at com.ullink.extranet.module.orderBookMonitoring.odiSysConnection.threadPool.WorkerThread.run(WorkerThread.java:38)
Caused by: org.postgresql.util.PSQLException: ERROR: could not open relation 1663/16403/16450: Invalid argument
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
... 12 more
Can someone help me, it seems to be a bug, because I don't see anything strage in my code, no!!!
thank you very much for your help