bonjour j ai un probleme de performence pour une requete
et mon fichier hbm
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 @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; }
j 'ai un batch de 325 lignes a executé.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 <?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>
Le tout prend plus de 5 min.
Est ce qu il y a une solution merci
Partager