Hello everyone!We have a application with a process which has a lot of things to calculate a date for a case file.The architecture is Hibernate 3.0.5 working with Spring 2.0.5 in a Weblogic Server 11.What happen? we experience a timeout but we don't know the reason.We suspect something related with Hibernate due to the trace. But there are many reasons or kind of trace for the timeout.We haven't got blocked tables or rows. Looking the stack packs we see that the top five of querys take at most 4'.

<[STUCK] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "675" seconds working on the request "Http Request: /gs_intranet/altaSolicitud.do", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace: org.hibernate.util.IdentityMap.entryList(IdentityMap.java:184) org.hibernate.util.IdentityMap.entries(IdentityMap.java:63) org.hibernate.event.def.AbstractFlushingEventListener.prepareCollectionFlushes(AbstractFlushingEventListener.java:152) org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:63) org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:39) org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:711) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1315) org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300) org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:433)

You can only be sure if you investigate the actual SQL code that Criteria generates for you.

Quote:

What I can't understand is why the timeout ocurres in differents parts of the code, either in a method or in another.

When database resources are saturated, query execution time will increase and some will generate timeouts. There's even a mathematical explanation for this, it's called Little's Law. Although you wish you can isolate the issue to a single Criteria query, I have a feeling this will require you a deep-level analysis:

- OS metrics- database metrics- SQL execution plans

It's easier to tackle this issue if you have a DBA on your team. After all, that's what DevOps is all about. If you don't have a DBA, then you should read High-Performance MySQL or something similar, depending on what DB you run in production.