-->
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.  [ 1 post ] 
Author Message
 Post subject: performing problem for my request
PostPosted: Wed Mar 25, 2009 7:46 pm 
Regular
Regular

Joined: Wed Jan 28, 2009 8:31 pm
Posts: 54
Hi I've been having performing issues for my request

Code:
@SuppressWarnings("unchecked")
   public List<InfogenePojo> find(String noGroupe, String noCert) {
      Session session = null;
      List<InfogenePojo> list = null;
      try {

         session = HibernateUtil.getSessionFactory().getCurrentSession();
         session.beginTransaction();
         list = session
               .createQuery(
                     "FROM InfogenePojo inf where inf.id.noCertificat like ? and inf.id.noGroupe = ? order by inf.id.dtEvenement desc")
               .setString(0, noCert + "%").setString(1, noGroupe).list();
         if (list.size() == 0)
            return null;
      } catch (HibernateException e) {
         HibernateUtil.getSessionFactory().getCurrentSession()
               .getTransaction().rollback();
         Log.setCodeRetour(8);
         throw new ServiceException(e.getMessage(), e);

      } finally {

         HibernateUtil.getSessionFactory().close();

      }
      return list;
   }

et mon fichier hbm
Code:



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="pojo">
   <class
      name="InfogenePojo"
      table="INFOGENE"
      lazy="false"
   >
   
   
   
   
    <composite-id name="id" class="ca.canassistance.pojo.InfogeneId">

        <key-property name="noGroupe" column="IG_NO_GROUPE" type="string" length="6"/>
        <key-property name="noCertificat" column="IG_NO_CERTIFICAT" type="string"  length="10"/>
        <key-property name="dtEvenement" column="IG_DT_EVENEMENT" type="integer" length="8"/>
        <key-property name="noDossier" column="IG_NO_DOSSIER" type="string" length="6"/>
      </composite-id>

      <property
         name="doubleAss"
         column="IG_ID_DOUBLE_ASS"
         type="string"
         not-null="false"
         length="1"
         lazy="false"
      />
      
      <property
         name="groupeClient"
         column="IG_GROUPE_CLIENT"
         type="string"
         not-null="false"
         length="8"
         lazy="false"
      />
      <property
         name="noCertificatSam"
         column="IG_NO_CERTIFICAT_SAM"
         type="string"
         not-null="false"
         length="20"
         lazy="false"
      />
      
      
      <property
         name="idUser"
         column="IG_ID_USER"
         type="string"
         not-null="false"
         length="4"
         lazy="false"
      />
      <property
         name="dtModif"
         column="IG_DT_MODIF"
         type="integer"
         not-null="false"
         length="8"
         lazy="false"
      />
      <property
         name="idAccident"
         column="IG_ID_ACCIDENT"
         type="string"
         not-null="false"
         length="1"
         lazy="false"
      />


</class>
</hibernate-mapping>


I have a batch of 325 lines to execute
however , this entire process takes more than
5 minutes which is abnormal


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.