0 Replies Latest reply on Jan 30, 2008 3:51 PM by Francis LIMOUSY

    Database question

    Francis LIMOUSY Newbie

      Hello,

      We developped a complete Seam 2.0 application but we notice very long database calls in a specific stateful bean.
      The rest of the application is fully fluid, using the same tables, but in this stateful bean one request takes 24 seconds each time.

      The funny part is that it's not always the same request which blocks :/

      Here is the log:

      21:41:43,941 INFO [STDOUT] Hibernate: select societe0_.societe_id as societe1_49_, societe0_.code_societe as code2_49_, societe0_.condition_reglement as condition4_49_, societe0_.logo_societe as logo3_49_, societe0_.taux_tva as taux5_49_ from societe societe0_ limit ?
      21:41:43,941 INFO [STDOUT] Hibernate: select societeuse0_.societe as societe1_, societeuse0_.societe_user_id as societe1_1_, societeuse0_.societe_user_id as societe1_50_0_, societeuse0_.societe as societe50_0_, societeuse0_.user as user50_0_ from societe_user societeuse0_ where societeuse0_.societe=?
      21:41:43,957 INFO [STDOUT] Hibernate: select user0_.user_id as user1_60_1_, user0_.email as email60_1_, user0_.equipe as equipe60_1_, user0_.login_name as login3_60_1_, user0_.nom as nom60_1_, user0_.password as password60_1_, user0_.prenom as prenom60_1_, societeuse1_.user as user3_, societeuse1_.societe_user_id as societe1_3_, societeuse1_.societe_user_id as societe1_50_0_, societeuse1_.societe as societe50_0_, societeuse1_.user as user50_0_ from user user0_ left outer join societe_user societeuse1_ on user0_.user_id=societeuse1_.user where user0_.user_id=?
      21:41:43,957 INFO [STDOUT] Hibernate: select user0_.user_id as user1_60_1_, user0_.email as email60_1_, user0_.equipe as equipe60_1_, user0_.login_name as login3_60_1_, user0_.nom as nom60_1_, user0_.password as password60_1_, user0_.prenom as prenom60_1_, societeuse1_.user as user3_, societeuse1_.societe_user_id as societe1_3_, societeuse1_.societe_user_id as societe1_50_0_, societeuse1_.societe as societe50_0_, societeuse1_.user as user50_0_ from user user0_ left outer join societe_user societeuse1_ on user0_.user_id=societeuse1_.user where user0_.user_id=?
      21:41:43,957 INFO [STDOUT] Hibernate: select user0_.user_id as user1_60_1_, user0_.email as email60_1_, user0_.equipe as equipe60_1_, user0_.login_name as login3_60_1_, user0_.nom as nom60_1_, user0_.password as password60_1_, user0_.prenom as prenom60_1_, societeuse1_.user as user3_, societeuse1_.societe_user_id as societe1_3_, societeuse1_.societe_user_id as societe1_50_0_, societeuse1_.societe as societe50_0_, societeuse1_.user as user50_0_ from user user0_ left outer join societe_user societeuse1_ on user0_.user_id=societeuse1_.user where user0_.user_id=?
      21:41:43,973 INFO [STDOUT] Hibernate: select user0_.user_id as user1_60_1_, user0_.email as email60_1_, user0_.equipe as equipe60_1_, user0_.login_name as login3_60_1_, user0_.nom as nom60_1_, user0_.password as password60_1_, user0_.prenom as prenom60_1_, societeuse1_.user as user3_, societeuse1_.societe_user_id as societe1_3_, societeuse1_.societe_user_id as societe1_50_0_, societeuse1_.societe as societe50_0_, societeuse1_.user as user50_0_ from user user0_ left outer join societe_user societeuse1_ on user0_.user_id=societeuse1_.user where user0_.user_id=?
      21:41:43,973 INFO [STDOUT] Hibernate: select user0_.user_id as user1_60_1_, user0_.email as email60_1_, user0_.equipe as equipe60_1_, user0_.login_name as login3_60_1_, user0_.nom as nom60_1_, user0_.password as password60_1_, user0_.prenom as prenom60_1_, societeuse1_.user as user3_, societeuse1_.societe_user_id as societe1_3_, societeuse1_.societe_user_id as societe1_50_0_, societeuse1_.societe as societe50_0_, societeuse1_.user as user50_0_ from user user0_ left outer join societe_user societeuse1_ on user0_.user_id=societeuse1_.user where user0_.user_id=?
      21:42:06,488 INFO [STDOUT] Hibernate: select collaborat0_.societe_id as societe21_1_, collaborat0_.collaborateur_id as collabor1_1_, collaborat0_.collaborateur_id as collabor1_12_0_, collaborat0_.adresse as adresse12_0_, collaborat0_.cadre as cadre12_0_, collaborat0_.code_collaborateur as code4_12_0_, collaborat0_.date_naissance as date5_12_0_, collaborat0_.departement_naissance as departem6_12_0_, collaborat0_.email as email12_0_, collaborat0_.fonction as fonction12_0_, collaborat0_.fournisseur_id as fournis23_12_0_, collaborat0_.nationalite as national8_12_0_, collaborat0_.nom as nom12_0_, collaborat0_.numero_securite_sociale as numero10_12_0_, collaborat0_.pays_naissance as pays11_12_0_, collaborat0_.prenom1 as prenom12_12_0_, collaborat0_.prenom2 as prenom13_12_0_, collaborat0_.prenom3 as prenom14_12_0_, collaborat0_.situation_de_famille as situation15_12_0_, collaborat0_.societe_id as societe21_12_0_, collaborat0_.structure as structure12_0_, collaborat0_.telephone_fixe as telephone17_12_0_, collaborat0_.telephone_portable as telephone18_12_0_, collaborat0_.type as type12_0_, collaborat0_.ville_naissance as ville20_12_0_ from collaborateur collaborat0_ where collaborat0_.societe_id=?
      21:42:06,613 INFO [STDOUT] Hibernate: select fonctionco0_.fonction_collaborateur_id as fonction1_31_0_, fonctionco0_.isCommercial as isCommer2_31_0_, fonctionco0_.valeur as valeur31_0_ from fonction_collaborateur fonctionco0_ where fonctionco0_.fonction_collaborateur_id=?
      


      As you can see, the "select user" is launched 5 times (?) and the last request last 24 seconds

      I realise that it's certainly more a Hibernate issue but I wonder if someone here experienced the same problem.

      Regards