tags:

views:

77

answers:

3

Hi,

I have a problem with some queries which get duplicated at the database automatically after 80 seconds. This colapses the database because each thread duplicates after 80 seconds if it has not received any information. I really don't know what to do...

This is the pool I have defined:

    <property name="c3p0.acquire_increment">1</property>  
 <property name="c3p0.idle_test_period">10800</property> <!-- seconds -->  
 <property name="c3p0.max_size">40</property>  
 <property name="c3p0.max_statements">0</property>  
 <property name="c3p0.min_size">0</property>  
 <property name="c3p0.timeout">100</property> <!-- seconds --> 
 <property name="connection.autoReconnectForPools">true</property>
 <property name="c3p0.acquireRetryAttempts">2</property>
 <property name="c3p0.automaticTestTable">C3P0TestTable</property>
 <property name="c3p0.testConnectionOnCheckout">true</property>

and this is the the query

duplicated after 80 secs.

select sol.idPeticionS as id, a.nombre as ayuda, pet.fechaAlta as fechaAlta, 
es.nombre as estadoS, pet.fechaIniPlazoRenov as fechaIniS, pet.fechaFinPlazoRenov as fechaFinS, 
er.nombre as estadoR, pr.fechaIniPlazoRenov as fechaIniR, pr.fechaFinPlazoRenov as fechaFinR, ben.nombre as nbenef, ben.apellido1 as a1benef, ben.apellido2 as a2benef, 
ent.nombreEntidad as entidad, usr.nombre as usrN, usr.apellido1 as usrA1, 
usr.apellido2 as usrA2, pet.fechaValidacion as fechaVal, pet.fechaPedido as fechaPed,
pet.fechaCaducidad as fechaCad, agrup.nombre as nombreAgrup, pet.idMotivo as motivo,  
es.idEstado as idEstadoS, a.activa as activa, pet.responsable as familiarResponsable,
pet.idHistoricoAyuda as idHistorico, pet.personaValoracion as personaValoracion, 
CONCAT_WS(' ',dir.calle,(cast(dir.numeroA as char)),(cast(dir.numeroB as char)),
dir.escalera,dir.piso,dir.puerta,dir.localidad) as direccion, ben.idBeneficiario as idbenef 
FROM solicitudes sol 
inner join peticiones pet 
on sol.idPeticionS = pet.idPeticion 
inner join usuarios usr on pet.usuarioAlta=usr.login 
inner join ayudas a on sol.idAyuda = a.idAyuda 
inner join estadossolicitud es on pet.idEstado = es.idEstado 
inner join entidades ent on pet.idEntidad = ent.idEntidad 
inner join beneficiarios ben on sol.idBeneficiario = ben.idBeneficiario 
inner join agrupaciones agrup on agrup.idEntidad = usr.idEntidad 
inner join direcciones dir on pet.idDireccion = dir.idDireccion 
left join 
    (select 
          max(r.idPeticionR) as idPeticionR, 
          r.idPeticionS from renovaciones r
     group by r.idPeticionS) r on r.idPeticionS = sol.idPeticionS 
left join peticiones pr on pr.idPeticion = r.idPeticionR 
left join estadossolicitud er on pr.idEstado = er.idEstado 
WHERE pet.tipo='S' AND usr.IdEntidad=29 AND pet.FechaAlta>= '2008-06-01 00?' 
AND pet.FechaAlta<= '2008-12-32 00?' 
ORDER BY pet.idPeticion DESC limit 10;

Thanks a lot!

Thank you very much for your time.

A: 

Query moved. Any ideas about what's driving me mad? Thanks!

keshone
better edit your question and add the query there, then delete your answer.
Bozho
I've added this to your questions please delete
John Nolan
A: 

Nobody knows anything about how to solve this? :)

Thanks!!

keshone
A: 

I've been many days trying to find a solution and I cannot find it.

I've seen that the query is not the problem, I don't know why but queries keep getting duplicated...

I'd really appreciate that somebody knew how to solve my problem... it's been a long time and no solutions come up.

Thank you very much for your time!

keshone