-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Regarding performance
PostPosted: Mon Dec 04, 2006 6:09 am 
Newbie

Joined: Sat Dec 02, 2006 4:23 am
Posts: 17
HI all,
my application is running correct.But after sometime my tomcat requires resart.When i retart my server,it takes a long time time to stop throwing could stop the server.When i start it again it works for some hits.
Iam using oracle 10g.The datas in the table is also very low.Here is the code.
Code:
<hibernate-configuration>     
    <session-factory>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver
</property>
        <property name="connection.url">jdbc:oracle:thin:@//</property>
        <property name="connection.username">user</property>
        <property name="connection.password">pass</property>

   
        <property name="connection.pool_size">1</property>


        <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
 
     
        <property name="current_session_context_class">thread</property>
        <property name="hibernate.jdbc.batch_size">20</property>

       
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

     
        <property name="show_sql">true</property> 
        <property name="hibernate.format_sql">true</property>

        <property name="hbm2ddl.auto">update</property> 
         
          <mapping resource="com/eserv/reports/Employees/Employees.hbm.xml"/>
       
     
  </session-factory>

</hibernate-configuration>


            Can anybody help me to solve this problem
Regards,
jasmine


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 2:06 pm 
Newbie

Joined: Tue Sep 19, 2006 4:13 am
Posts: 18
Do you see some exception trace on the server???


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 2:07 am 
Newbie

Joined: Sat Dec 02, 2006 4:23 am
Posts: 17
Hi all,
Thanx 4 ur reply.Iam getting out of memory exception after hitting my servlet again & again.Whenever i reload my classes it takes a memory of 8MB.Here is the code i suspect:
Code:
static{
         
result = HibernateUtil.getSessionFactory).getCurrentSession() .createCriteria(EmployeesId.class)
    .addOrder(Order.desc("employeeid"))
    .list();

   } 


I dont want to query my table over & over.Instead iam querying newly updated & inserted rows.Is anyother ways to achieve this.Kindly help me to do this.Is my approach correct.

Regards,
jasmine


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 1:11 pm 
Newbie

Joined: Tue Sep 19, 2006 4:13 am
Posts: 18
This is not specific to any query. I guess that the session is not beeing closed properly event after the thread has completed execution.
This creates the session to be hydrated and hence the exception.
Please check or debug your code, i hope you find something on this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 4:49 am 
Newbie

Joined: Sat Dec 02, 2006 4:23 am
Posts: 17
Hi,
here is the code for the servlet that iam hitting.
Code:
public void doPost(HttpServletRequest request,HttpServletResponse response)
                  throws IOException,ServletException{
                try {   
         // Begin unit of work
         HibernateUtil.getSessionFactory().getCurrentSession().beginTransaction();       
         PrintWriter out = response.getWriter(); 
         
         HrmEmployeesList.listEmployees(out);
         out.flush();
         out.close();
         //End unit of work
         HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().commit();
      
      }catch (Exception ex) {
         HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();
         throw new ServletException(ex);
      }
      finally {
         
   HibernateUtil.getSessionFactory().getCurrentSession().close();
        }

listEployees(out) is a java method which iterates & prints all the employees list.the result list was being created by the static block which i posted before is also in the same java class.
Hope u get understand.I want to know wheather tomcat is keeping its heap memory without releasing out?or else any tips to release tomcat memory


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.