-
1. Re: JBossCMP issuing UPDATEs when not needed (also: performa
pazu Apr 3, 2002 1:33 PM (in response to pazu)Some more info: here is a log excerpt when trying to load a single entity (AF) with 3 relationships (with Cliente, Agente and AFItem).
[pre]
2002-04-03 15:28:18,306 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCJBossQLQuery.AF.findAll] Executing SQL: SELECT t0_a.af_id FROM af t0_a ORDER BY t0_a.af_data_preenchimento DESC
2002-04-03 15:28:18,438 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AF] Executing SQL: SELECT af_numero, af_finalizada, af_data_preenchimento FROM af WHERE (af_id=?)
2002-04-03 15:28:18,447 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.AF] Executing SQL: SELECT af_agen_id FROM af WHERE (af_id=?)
2002-04-03 15:28:18,486 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Agente] Executing SQL: SELECT DESCRICAO FROM AGENTES WHERE (AGENTE_ID=?)
2002-04-03 15:28:18,504 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.AF] Executing SQL: SELECT af_clie_id FROM af WHERE (af_id=?)
2002-04-03 15:28:18,551 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Cliente] Executing SQL: SELECT clie_nome, clie_ende_bairro, clie_ende_cep, clie_ende_cidade, clie_ende_uf, clie_ende_fax, clie_ende_logra, clie_ende_telefone FROM cliente WHERE (clie_id=?)
2002-04-03 15:28:18,572 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.AF] Executing SQL: SELECT afpr_id FROM af_produto WHERE (afpr_af_id=?)
2002-04-03 15:28:18,587 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.AF] Executing SQL: UPDATE af SET af_agen_id=?, af_clie_id=? WHERE af_id=?
2002-04-03 15:28:18,591 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.AF] Create: Rows affected = 1
[/pre]
Please note that JBoss issues an UPDATE for each relation loaded. My code didn't called a single setXXX() method.
This is a simple case, just to illustrate the problem. Things goes bad when there are lots of entities to be loaded. -
2. Re: JBossCMP issuing UPDATEs when not needed (also: performa
pazu Apr 3, 2002 1:54 PM (in response to pazu)More performance issues: are all relations loaded when the entity is loaded? I noticed relations are being loaded even when I haven't asked for them. And they aren't specified on the eager-load-group either.