[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - 400 Queries generated for one page !!

yj4jboss do-not-reply at jboss.com
Mon Feb 18 05:02:11 EST 2008


Hi All,
   We have a relatively simple web application running on 
 - jboss seam 2.0.0GA, 
 - jboss-4.2.2.GA
 - Hibernate (the version that comes with Seam 2.0.0.GA)
 - Rich faces 3.1.3.GA
 - Mysql


We always had complaints about the application being slow and have been trying to sort out the problem. As such, we have tried to verify the number of queries generated for one of the pages by using logs for mysql using Mysql Administrator.


And on the first page we tested, around 400 queries were generated for this page only.


Below is our persistence.xml file


  | 
  |   <?xml version="1.0" encoding="UTF-8" ?> 
  | - <!--  Persistence deployment descriptor for dev profile 
  |   --> 
  | - <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
  | - <persistence-unit name="aewa">
  |   <provider>org.hibernate.ejb.HibernatePersistence</provider> 
  |   <jta-data-source>java:/SeamAppDS</jta-data-source> 
  | - <properties>
  |   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" /> 
  | - <!--          <property name="hibernate.hbm2ddl.auto" value="validate"/>
  | 	   <property name="hibernate.show_sql" value="false"/>
  |          <property name="hibernate.format_sql" value="true"/>
  | 	   
  |   --> 
  |   <property name="jboss.entity.manager.factory.jndi.name" value="java:/aewaEntityManagerFactory" /> 
  | - <!--   aewa modifications 
  |   --> 
  |   <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /> 
  |   <property name="hibernate.transaction.flush_before_completion" value="true" /> 
  |   <property name="hibernate.cache.use_query_cache" value="true" /> 
  |   <property name="hibernate.jdbc.wrap_result_sets" value="true" /> 
  |   <property name="transaction.auto_close_session" value="true" /> 
  |   <property name="hibernate.show_sql" value="false" /> 
  | - <!--   End of aewa modifications 
  |   --> 
  |   </properties>
  |   </persistence-unit>
  |   </persistence>
  | 
  | 
  | 

Can someone please help us on how to improve the performance of the application, especially by limiting the number of queries generated.

Thnx

Yogesh



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130042#4130042

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130042



More information about the jboss-user mailing list