-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: org.hibernate.exception.GenericJDBCException: could not exec
PostPosted: Mon Sep 29, 2008 11:29 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 3:06 pm 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
Looks like a problem with postgres. Try to reindex your db.
If it still doesn't work, you can try to drop and recreate all indexes.

Christophe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 4:06 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
ok thank you, i will try this


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 4:58 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
I droped all indexes, it seems to work now.

EDIT : No, I was wrong, it doesn"t work

Thank you Christophe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 7:02 am 
Beginner
Beginner

Joined: Wed May 16, 2007 7:12 am
Posts: 41
Location: London
Quote:
ERROR: could not open relation 1663/16403/16450: Invalid argument


Hmm.. Could you try picking up the sql query and executing it for us please

_________________
Dinesh Mahadevan

Visit me at http://www.yelani.com/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 8:25 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
Yhank you for reply,
I don't know if It's really what you want :

I excuted this request on Postgres :
select * from tblorders where order_listorderid = '122218408521';

result :
;250;0;0;"FR0000131906";"PA";"ulb_fixaccess";"testclient";"UBS";"buy";"RENA";"";"20080923-15:34:45.092";"";"11c8fd92664-000";"EUR";"";"pending";"";"UBS";"dealing";"122218408521";"122218408522-1";"market";"";
;200;0;0;"FR0000054900";"PA";"ulb_fixaccess";"testclient";"UBS";"buy";"TFFP";"";"20080923-15:34:45.092";"";"11c8fd92664-001";"EUR";"";"pending";"";"UBS";"dealing";"122218408521";"122218408523-2";"market";"";
;250;0;0;"FR0000131906";"PA";"ulb_fixaccess";"testclient";"UBS";"buy";"RENA";"";"20080923-15:34:45.092";"";"11c8fd92664-002";"EUR";"";"pending";"";"UBS";"dealing";"122218408521";"122218408524-3";"market";"";

The problem is that the same method is used later and it works without any problem.

This exception occurs, when I restart all my platform (Tomcat and other open systems).

The origin: When I start the platform, I must synchronise my local database width data coming from another system. In an interval of 1seconde I receive thousands of items. So during this synchronisation the exception appear.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 8:55 am 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
Check these messages:

http://archives.free.net.ph/message/20061002.052310.f8113ead.en.html
http://archives.free.net.ph/message/20080116.004214.002d9d55.ja.html

What version of postgres are you running, on what platform?

I have also read that it could be an anti-virus scan that can cause the problem.

Christophe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 9:09 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
I have Postgres 8.1,So I must upgrade to 8.3 !

Platform : Windows XP / Tomcat / Eclipse WTP 3.2 ...

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 10:22 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
thank you very much Christophe.

I upgrade Postgres to 8.3 and It works (I tried 4 times ...)

Good luck


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.