Hi,
I am using Hibernate 3.0. I have bad performance on query on two of my entities/table, because the binding of parameters is long.
For a very simple mapping, and a very simple request the time for binding parameter is long.
Here is the mapping :
Code:
<hibernate-mapping>
<class name="Event" table="Event" >
<id name="ideEvent" type="java.lang.Long">
<column name="IdeEvt" precision="10" scale="0" />
<generator class="assigned" />
</id>
<property name="notificationId" type="java.lang.Long">
<column name="IdeMatisse" precision="10" scale="0" not-null="true" />
</property>
Here is the request :
Code:
final DetachedCriteria query = DetachedCriteria.forClass(Event.class);
query.add( Property.forName("notificationId").eq(new Long(5723325));
return( List<com.bnpparibas.eqd.tresoost.matisse.enterprise.entity.Event>) getHibernateTemplate().findByCriteria(query);
Here is the log
Code:
2007-04-20 18:01:49,822 DEBUG (NullableType.java:80) - binding '5723325' to parameter: 1
2007-04-20 18:02:01,118 DEBUG (AbstractBatcher.java:374) - about to open ResultSet (open ResultSets: 0, globally: 0)
Same problem in HQL with binding
With no binding (request in HQL), no problem of performance