org.hibernate.exception.GenericJDBCException: could not execute query
Bonjour,
J'ai une exception qui est lancée seulement quand j'exécute une méthode pour la première fois, aucune exception n'est lancée après.
Voila la méthode qui est exécutée à chaque démarrage de mon application :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| 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();
}
//}
} |
l'exeception est lancée dans cette méthode :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| 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();
}
} |
voila le stacktrace
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| 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 |
Pouvez vous m'aider, merci