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.  [ 1 post ] 
Author Message
 Post subject: session.createCriteria generate exception under stress
PostPosted: Tue Mar 18, 2008 11:57 am 
Newbie

Joined: Fri Sep 15, 2006 5:11 am
Posts: 3
Hibernate version:3

Full stack trace of any exception that occurs:
Code:
java.net.NoRouteToHostException: Cannot assign requested address
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:180)
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:220)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768)
        at com.mysql.jdbc.Connection.<init>(Connection.java:440)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:291)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:277)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:259)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:241)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2145)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
        at org.hibernate.loader.Loader.list(Loader.java:2024)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1562)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
        at com.my.packege.HibernateEntityDao$11.doInHibernate(HibernateEntityDao.java:349)


The lines in my code that invoke the error: (in com.my.packege.HibernateEntityDao)
Code:
Collection coll = (Collection) getHibernateTemplate().execute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                session.setCacheMode(CacheMode.IGNORE);
                return session.createCriteria(hibernateObjectClass)
                        .add(Expression.like(criteriaName, criteriaValue))
                        .addOrder(Order.asc(orderField)).list();
            }

Name and version of the database you are using: MySql 5.0
Server: Tomcat 6.0
OS: CentOS 5.0

Hi, I'm not even sure this is an Hibernate issue but would love it if anyone here could comment. the above exception happens when I stress test my application with a load test tool. many places in the code that call session.createCriteria seem to generate this problem (like the code segment I've added). I've looked into different aspects of the problem and searched the web but could not find a solution. it seems like for some reason the application can not get connections out of the connection pool, I've enabled maxPoolSize of 100 in my config and many more in the MySQL config but no luck.

Any ideas?
Thanks in advance.


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.