Problem:
My application is blocking on the BatcherImpl in a loop after having worked in the first items of the loop ....
code
I am using Spring framework.
_________________________________________
Resource resource = null;
for( int i = 0; i<equipments.size(); i++ )
{
resource = ((Equipment)equipments.get(i)).getResource();
log.debug( "resource id : " + resource.getId() );
resourceDao.findTracksByResource( resource );
containers.add( ContainerTransformer.transform( resource ) );
}
________________________________________
public void findTracksByResource(Resource resource) {
if ( resource==null ) { return; }
Query query = null;
List tracks = null;
StringBuffer buff = new StringBuffer("SELECT track FROM Track track WHERE track.id.conNum='");
buff.append( resource.getId() );
buff.append("' AND track.trackLogonId<>'silog' AND track.trackStatus IN ('IDF','IFC','IIT','IRI','MEA','MOH','MOS','TAF','TDF','TOF','TPF','XOF','XRX') AND track.id.trackDate BETWEEN CURRENT_DATE-100 AND CURRENT_DATE order by track.id.trackDate DESC, track.id.trackTime DESC");
try
{
query = getHibernateTemplate().createQuery(this.getSession(),buff.toString());
log.debug(" --> query created from getHibernateTemplate() ");
tracks = query.list();
log.debug(" --> query launched ");
if ( tracks != null ) { log.debug( "--> Tracks size : " + tracks.size() ); }
}
catch( Exception e )
{
e.printStackTrace();
}
resource.setTracks( filterTracks( tracks ) );
return;
}
Hibernate version:
the last one
Full stack trace of any exception that occurs:
none
Name and version of the database you are using:
Oracle9i
The generated SQL (show_sql=true):
select track0_.CONTAINER_NUMBER as CONTAINE1_, track0_.STATUS_DATE as STATUS_D2_, track0_.STATUS_TIME as STATUS_T3_, track0_.CON_STATUS as CON_STATUS, track0_.CON_LOCATION as CON_LOCA5_, track0_.VOYAGE_REFERENCE as VOYAGE_R6_, track0_.PORT_OF_ORIGIN as PORT_OF_7_, track0_.PORT_OF_LOADING as PORT_OF_8_, track0_.POINT_DISCH as POINT_DI9_, track0_.FINAL_POD as FINAL_POD, track0_.FINAL_DESTINATION as FINAL_D11_, track0_.POINT_TO as POINT_TO, track0_.BOL_NUMBER as BOL_NUMBER, track0_.LOGON_ID as LOGON_ID from CON_TRACKING track0_ where (track0_.CONTAINER_NUMBER='ECMU4170379' )AND(track0_.LOGON_ID<>'silog' )AND(track0_.CON_STATUS IN('IDF' , 'IFC' , 'IIT' , 'IRI' , 'MEA' , 'MOH' , 'MOS' , 'TAF' , 'TDF' , 'TOF' , 'TPF' , 'XOF' , 'XRX'))AND(track0_.STATUS_DATE BETWEEN CURRENT_DATE-100 AND CURRENT_DATE ) order by track0_.STATUS_DATE DESC , track0_.STATUS_TIME DESC
Debug level Hibernate log excerpt:
8610 [main] DEBUG com.cmacgm.tracking.util.ShipmentTransformer -cascadeTransform - resource id : ECMU4170379
8610 [main] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils -getSession - Opening Hibernate session
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -<init> - opened session
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -find - find: SELECT track FROM Track track WHERE track.id.conNum='ECMU4170379' AND track.trackLogonId<>'silog' AND track.trackStatus IN ('IDF','IFC','IIT','IRI','MEA','MOH','MOS','TAF','TDF','TOF','TPF','XOF','XRX') AND track.id.trackDate BETWEEN CURRENT_DATE-100 AND CURRENT_DATE order by track.id.trackDate DESC, track.id.trackTime DESC
8610 [main] DEBUG net.sf.hibernate.engine.QueryParameters -traceParameters - named parameters: {}
8610 [main] DEBUG net.sf.hibernate.hql.QueryTranslator -compile - compiling query
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushEverything - flushing session
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushEntities - Flushing entities and processing referenced collections
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushCollections - Processing unreferenced collections
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushCollections - Scheduling collection removes/(re)creates/updates
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushEverything - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -flushEverything - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
8610 [main] DEBUG net.sf.hibernate.impl.SessionImpl -autoFlushIfRequired - Dont need to execute flush
8610 [main] DEBUG net.sf.hibernate.hql.QueryTranslator -logQuery - HQL: SELECT track FROM com.cmacgm.lara.data.Track track WHERE track.id.conNum='ECMU4170379' AND track.trackLogonId<>'silog' AND track.trackStatus IN ('IDF','IFC','IIT','IRI','MEA','MOH','MOS','TAF','TDF','TOF','TPF','XOF','XRX') AND track.id.trackDate BETWEEN CURRENT_DATE-100 AND CURRENT_DATE order by track.id.trackDate DESC, track.id.trackTime DESC
8610 [main] DEBUG net.sf.hibernate.hql.QueryTranslator -logQuery - SQL: select track0_.CONTAINER_NUMBER as CONTAINE1_, track0_.STATUS_DATE as STATUS_D2_, track0_.STATUS_TIME as STATUS_T3_, track0_.CON_STATUS as CON_STATUS, track0_.CON_LOCATION as CON_LOCA5_, track0_.VOYAGE_REFERENCE as VOYAGE_R6_, track0_.PORT_OF_ORIGIN as PORT_OF_7_, track0_.PORT_OF_LOADING as PORT_OF_8_, track0_.POINT_DISCH as POINT_DI9_, track0_.FINAL_POD as FINAL_POD, track0_.FINAL_DESTINATION as FINAL_D11_, track0_.POINT_TO as POINT_TO, track0_.BOL_NUMBER as BOL_NUMBER, track0_.LOGON_ID as LOGON_ID from CON_TRACKING track0_ where (track0_.CONTAINER_NUMBER='ECMU4170379' )AND(track0_.LOGON_ID<>'silog' )AND(track0_.CON_STATUS IN('IDF' , 'IFC' , 'IIT' , 'IRI' , 'MEA' , 'MOH' , 'MOS' , 'TAF' , 'TDF' , 'TOF' , 'TPF' , 'XOF' , 'XRX'))AND(track0_.STATUS_DATE BETWEEN CURRENT_DATE-100 AND CURRENT_DATE ) order by track0_.STATUS_DATE DESC , track0_.STATUS_TIME DESC
8610 [main] DEBUG net.sf.hibernate.impl.BatcherImpl -logOpenPreparedStatement - about to open: 0 open PreparedStatements, 0 open ResultSets
|