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