Hi;
I use jonas for a web-based library-like application. So, i use three entity
beans (authors, subjects, and documents) and a stateless session bean (biblio)
for accessing them. All sessions beans are BMP in order to have postgreSQL
automatically generating primary keys at insert time (if there were a way to do
this with BMP, i would be interested). I've used isModified method to avoid
useless transactions. Altough, i'm rather effraid by the number of transactions
encountered for a simple lookup:
Here's a short commented log extract, showing all non-business method and
SQL queries:
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
// My SB is initialized, and lookup method is called : ok

[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
  select oid from document order
// This is a general findall method in my entitybeans superclass

by titre [EMAIL PROTECTED]()
  select * from document where oid=27362
  select * from document_auteur where document_oid=27362
  select * from document_rubrique where document_oid=27362
// This shows tha       t a first EB is used for lookup, and others for
instanciation. Isn't it a waste of ressource, where a SB could do lookup also ?

[EMAIL PROTECTED]()
// why already store a just-loaded bean ?

[EMAIL PROTECTED]()
select * from auteur where oid=26600
update document set titre='Apport du mod�le objet en syst�matique',resume='Avantages 
du mod�le objet pour r�pondre aux besoins actuels de repr
�sentation des connaissances en 
syst�matique',url='',date_publication='2000-04-15',auteur_publication_oid=26600 where 
oid=27362
delete from document_auteur where document_oid=27362
insert into document_auteur (document_oid,auteur_oid) values(27362,26600)
delete from document_rubrique where document_oid=27362
[EMAIL PROTECTED]()
select * from rubrique where oid=27361
insert into document_rubrique (document_oid,rubrique_oid) values(27362,27361)
[EMAIL PROTECTED]()
select * from rubrique where oid=27568
insert into document_rubrique (document_oid,rubrique_oid) values(27362,27568)
[EMAIL PROTECTED]()
update auteur set prenom='Guillaume',nom='Rousse' where oid=26600
[EMAIL PROTECTED]()
update rubrique set nom='syst�matique',parent_oid=0 where oid=27361
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
select * from rubrique where oid=27360
update rubrique set nom='mod�le objet',parent_oid=27360 where oid=27568
[EMAIL PROTECTED]()
// explanation : there is one author, and three subjects (rubriques) for my
document, and each is also loaded first, then stored as soon, as the document.
Same remark as above : why ?

[EMAIL PROTECTED]()
select * from document where oid=27362
select * from document_auteur where document_oid=27362
select * from document_rubrique where document_oid=27362
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
select * from auteur where oid=26600
update document set titre='Apport du mod�le objet en syst�matique',resume='Avantages 
du mod�le objet pour r�pondre aux besoins actuels de repr�sentation des connaissances 
en syst�matique',url='',date_publication='2000-04-15',auteur_publication_oid=26600 
where oid=27362
delete from document_auteur where document_oid=27362
insert into document_auteur (document_oid,auteur_oid) values(27362,26600)
delete from document_rubrique where document_oid=27362
[EMAIL PROTECTED]()
select * from rubrique where oid=27361
insert into document_rubrique (document_oid,rubrique_oid) values(27362,27361)
[EMAIL PROTECTED]()
select * from rubrique where oid=27568
insert into document_rubrique (document_oid,rubrique_oid) values(27362,27568)
[EMAIL PROTECTED]()
update auteur set prenom='Guillaume',nom='Rousse' where oid=26600
[EMAIL PROTECTED]()
update rubrique set nom='syst�matique',parent_oid=0 where oid=27361
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
select * from rubrique where oid=27360
update rubrique set nom='mod�le objet',parent_oid=27360 where oid=27568
[EMAIL PROTECTED]()
update rubrique set nom='informatique',parent_oid=0 where oid=27360              
// And all this stuff happens again, 5 times at all...

Altough of caching objects, in fact i have unstopping queries against my
database. I imagine overall 5 time repetition can be caused by a poor
relationships design, but not the load/store immedialty process, neither the
wasted EB for lookup. What have i missed ?

  -- 
Guillaume Rousse
Iremia - Universit� de la R�union

Sleep doesn't exists. Just lack of cafeine.
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to