TransactionRolledBackException: transaction timout while rem
pazu Mar 6, 2002 7:49 AMHere is a nice exception I've been getting most of the times I try to remove an entity (CMP 2.0):
WARN [TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=lain.wired.net//83, BranchQual=] timed out. status=STATUS_ACTIVE ERROR [BeanLock] Saw rolled back tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=lain.wired.net//83, BranchQual=] waiting for methodLock. ERROR [LogInterceptor] TransactionRolledbackException, causedBy: java.lang.RuntimeException: Transaction marked for rollback, possibly a timeout at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(QueuedPessimisticEJBLock.java:191) at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPessimisticEJBLock.java:137) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:104) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:474) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:308) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$EntityProxy.invoke(BaseLocalContainerInvoker.java:412) at $Proxy76.getAFItemValue(Unknown Source) (...)
Needless to say, the stack trace goes on. A bit more information to help: there are other entities related to this one. I see SQL statements selecting the other entities on the log file. Here are them:
DEBUG [AFAction] Removendo produto 8B80808080808180
DEBUG [AFItem] Executing SQL: SELECT afpr_id,afpr_quantidade, afpr_referencia, afpr_descricao, afpr_preco_lista, afpr_preco_venda, afpr_af_id, afpr_prod_id FROM af_produto WHERE (afpr_id=?) OR (afpr_id=?) OR (afpr_id=?) OR (afpr_id=?) OR (afpr_id=?)
DEBUG [AF] Executing SQL: SELECT af_numero, af_finalizada, af_pedido, af_tipo, af_data_preenchimento, af_data_pedido, af_data_prevista, af_data_entrega, af_transporte, af_total_material, af_total_servico, af_valor_cat, af_pagamento_desc, af_pagamento_tipo, af_setor, af_sistema, af_nu_ramais_analogico, af_nu_ramais_digitais, af_nu_canais, af_nu_pa, af_nu_supervisao, af_nu_stack, af_agen_id, af_clie_id FROM af WHERE (af_id=?)
DEBUG [Cliente] Executing SQL: SELECT clie_ativ_id, clie_tipo, clie_pessoa, clie_dt_inclusao, clie_nome, clie_fantasia, clie_cgc_cpf, clie_inscest, clie_inscmun, clie_obs, clie_ende_bairro, clie_ende_cep, clie_ende_cidade, clie_ende_uf, clie_ende_fax, clie_ende_logra, clie_ende_telefone, clie_cont_bairro, clie_cont_cep, clie_cont_cidade, clie_cont_uf, clie_cont_fax, clie_cont_ende, clie_cont_telefone, clie_cobr_bairro, clie_cobr_cep, clie_cobr_cidade, clie_cobr_uf, clie_cobr_fax, clie_cobr_ende, clie_cobr_telefone, clie_contato, clie_email, clie_ativo, clie_agente_id FROM cliente WHERE (clie_id=?)
DEBUG [Agente] Executing SQL: SELECT FILIAL_ID, DESCRICAO, SENHA, LOGIN, NIVEL, DATASINC, COMISSAO FROM AGENTES WHERE (AGENTE_ID=?)
DEBUG [AF] Executing SQL: SELECT afpr_id FROM af_produto WHERE (afpr_af_id=?)
The first line is from my code. The log hangs just after the last line. Some minutes later I get the TransactionRolledBackException showed above.
The relation between the beans are like this:
AF 1 -> 1 Cliente
AF 1 -> 1 Agente
AF 1 -> n AFItem
I was trying to remove a AFItem. What could be causing this transaction take so long? My application is the only one accessing the database, so I believe there is no locking issues.