-->
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.  [ 2 posts ] 
Author Message
 Post subject: Load Test fails
PostPosted: Fri Jul 30, 2004 10:49 pm 
Newbie

Joined: Thu Mar 25, 2004 5:21 am
Posts: 3
Location: Melbourne, Australia
I have load test fails for simple servlet (the Cat example in hibernate document). I used jmeter to load test with Number of threads: 1000; Ramp-up Period (in second) 1; loop for ever. The test failled with outofmemorry exception, Tomcat refused connection and down.
My code is stored in: www.ehap.com.au/test.zip
This is the hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>

<session-factory>

<!-- Postgresql -->
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">
jdbc:postgresql://192.168.0.77:5432/ehap?autoReconnect=true
</property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">false</property>
<property name="hibernate.cache.provider_class">
net.sf.hibernate.cache.HashtableCacheProvider
</property>

<property name="show_sql">false</property>
<property name="show_sql">false</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>

<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.use_outer_join">false</property>
<property name="hibernate.c3p0.minPoolSize">5</property>
<property name="hibernate.c3p0.maxPoolSize">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statement">50</property>

<!-- Mapping files -->
<mapping resource="cats/Cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>

This is the servlet code:

import java.io.*;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import myUtils.*;
import net.sf.hibernate.*;
import cats.*;

/**
* @author h
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class CatServlet extends HttpServlet
{

public void init(ServletConfig config) throws ServletException
{
//TODO Method stub generated by Lomboz
}
protected void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();
out.println("start");
try
{
Session session = HibernateUtil.currentSession();
Transaction tx= session.beginTransaction();
Cat princess = new Cat();
princess.setName("Princess");
princess.setSex('F');
princess.setWeight(7.4f);
session.save(princess);
tx.commit();
HibernateUtil.closeSession();
out.println("end");
}
catch(HibernateException e)
{
out.println(e);
}
//TODO Method stub generated by Lomboz
}
protected void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
//TODO Method stub generated by Lomboz
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 10:53 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
So, you do have a profiler?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.