Hi,
I’m using HQL to perform a query, this HQL Query takes approximately 500 ms to execute in a single thread, but with 20 threads it takes more than 10000 ms.
It seems that for each concurrent thread there is an increase of 30% in processing time.
This is not a connection pool issue because I have already checked that (the number of connections is above 20 and there’s no waiting time to obtain the connection).
When I try to do that query using hibernate SQLQuery the average time spent is 350 ms.
Using a profiling I get several times the following blocked code:
java.lang.Class.forName(String)
org.hibernate.util.ReflectHelper.classForName(String)
org.hibernate.util.ReflectHelper.getConstantValue(String)
org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(AST)
org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(AST)
org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(AST)
org.hibernate.hql.ast.QueryTranslatorImpl.parse(boolean)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(Map, boolean, String)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(Map, boolean)
org.hibernate.engine.query.HQLQueryPlan.<init>(String, String, boolean, Map, SessionFactoryImplementor)
org.hibernate.engine.query.HQLQueryPlan.<init>(String, boolean, Map, SessionFactoryImplementor)
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(String, boolean, Map)
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(String, boolean)
org.hibernate.impl.AbstractSessionImpl.createQuery(String)
org.hibernate.impl.SessionImpl.createQuery(String)
My hibernate properties are:
Code:
<util:map id="hibernateProperties">
<entry key="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<entry key="hibernate.bytecode.use_reflection_optimizer"
value="false" />
<entry key="hibernate.transaction.auto_close_session"
value="false" />
<entry key="hibernate.transaction.flush_before_completion"
value="true" />
<entry key="hibernate.connection.release_mode"
value="auto" />
<entry key="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
<entry key="hibernate.validator.apply_to_ddl" value="false" />
<entry key="hibernate.show_sql" value="true" />
<entry key="hibernate.schema_mapping" value-ref="schemaMapping" />
</util:map>
Can anyone please help me?