[JBoss Seam] - Re: Design Patterns/Best Practices
by kasim
btw to expand on your first question.
Just because there is little code needed, doesn't mean there aren't design patterns or maybe the better term is "good design".
Since Seam comes pre-loaded with soo many options you are going to have lots of decisions to make.
ie:
- When to use a Stateful vs Stateless vs JavaBean
- When to use the query objects as a DAO layer vs when to call it on your own from the business teir with the entity manager.
- Scopes, when to apply each scope, determining when it's appropriate
- Heck even down to when the EB / SB NEEDS to be a Seam component vs just being a regular EB / SB / Pojo.
But as Pete said ... it's mostly up to you. Just be careful i've noticed beginners tend to take some easy ways out.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124934#4124934
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124934
18 years, 2 months
[JBoss Seam] - Database question
by limousyf
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
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124930#4124930
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124930
18 years, 2 months
[JBoss Seam] - Problem with Ajax and injection with radio boxes
by kasim
Yeah, i was wondering if anyone else had this issue and if there was a work around.
So basically.
I have a page with a bunch of inputs, i am using an Ajax call on a list box so when a certain list box is triggered it determines whether you need to select a radio box below.
The radio box is a string that i apply an @In annotation to it.
IT comes to the page disabled.
When i select a specific item it will enable the radio box. I go to select a radio button and submit it. However nothing gets injected.
Now here is the kicker, as i said it comes to the page disabled, if it comes to the page enabled and lets say you select somethign to disable, then go back to enabled it will WORK.
its only when you go to the page and the radio box is disabled initially does it fail.
Any ideas?? I can give some code if you need it but i am not sure if its a huge coding thing since as i said coming to the page enabled initially works.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124926#4124926
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124926
18 years, 2 months