I've tried something new today, instead of using the set... for the parameters i used fixed ones, and just called
list = getSession.createQuery(hql).list();
and the query run extremely fast. I'm just getting more and more confused...
I'm posting the code for the parameters:
WqlBaseIndexadaDAO baseDao = WqlBaseIndexadaDAOImpl.getInstance();
String periodo = baseDao.findByTipoBaseMaxPeriodo(WqlTipoBaseIndexada.JCR);
Query query = getSession()
.createQuery(hql)
.setParameter(WqlTipoBaseIndexada.PROP_ID_TIPOBASE_INDEXADA,
WqlTipoBaseIndexada.JCR, Hibernate.INTEGER)
.setParameter(GTipoIdentRegistrado.PROP_ID_TIPO_IDENTIFICADOR,
GTipoIdentRegistrado.ISSN, Hibernate.INTEGER)
.setParameter(WqlTipoVeiculoPublicacao.PROP_ID_TIPO_VEICULO_PUBLICACAO,
tipoVeiculo, Hibernate.INTEGER)
.setParameter(WqlVeiculoRIdentRegistrado.PROP_IDENTIFICADOR_REGISTRADO,
identificador, Hibernate.STRING)
.setParameter(WqlAreaEventoRTipoVeiculo.PROP_SITUACAO,
status, Hibernate.STRING)
.setParameter(WqlBaseIndexada.PROP_PERIODO_CLASSIFICACAO,
periodo, Hibernate.STRING);
List list = query.list();
BTW, I also tried to use the setInteger and setInteger methods, with no success.
Here's part of the debug trace. I've change the driver for jTDS and the lag is now "only" one minute
#webqualis# DEBUG [Loader ] result set row: 16 15:18:16,415 [main]
#webqualis# DEBUG [Loader ] result row: 15:18:16,415 [main]
#webqualis# DEBUG [IntegerType] returning '72' as column: col_0_0_ 15:18:16,415 [main]
#webqualis# DEBUG [IntegerType] returning '1' as column: col_1_0_ 15:18:16,415 [main]
#webqualis# DEBUG [ShortType ] returning '6' as column: col_2_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'CIÊNCIAS BIOLÓGICAS I ' as column: col_3_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'N' as column: col_4_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'B' as column: col_5_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'Acta Amazonica' as column: col_6_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning '0044-5967' as column: col_7_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning null as column: col_8_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'azul' as column: col_9_0_ 15:18:16,415 [main]
#webqualis# DEBUG [Loader ] result set row: 17 15:18:16,415 [main]
#webqualis# DEBUG [Loader ] result row: 15:18:16,415 [main]
#webqualis# DEBUG [IntegerType] returning '72' as column: col_0_0_ 15:18:16,415 [main]
#webqualis# DEBUG [IntegerType] returning '1' as column: col_1_0_ 15:18:16,415 [main]
#webqualis# DEBUG [ShortType ] returning '6' as column: col_2_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'CIÊNCIAS BIOLÓGICAS I ' as column: col_3_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'N' as column: col_4_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'B' as column: col_5_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'Acta Amazonica' as column: col_6_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning '0044-5967' as column: col_7_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning null as column: col_8_0_ 15:18:16,415 [main]
#webqualis# DEBUG [StringType] returning 'azul' as column: col_9_0_ 15:18:16,415 [main]
************************************************************************
here is where the problem happens, can you see the 1 minute plus lag that occurred? 15:18:16 -> 15:19:31
***********************************************************************
#webqualis# DEBUG [Loader ] result set row: 18 15:19:31,749 [main]
#webqualis# DEBUG [Loader ] result row: 15:19:31,749 [main]
#webqualis# DEBUG [IntegerType] returning '72' as column: col_0_0_ 15:19:31,749 [main]
#webqualis# DEBUG [IntegerType] returning '1' as column: col_1_0_ 15:19:31,749 [main]
#webqualis# DEBUG [ShortType ] returning '6' as column: col_2_0_ 15:19:31,749 [main]
|