Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Evan Siegel
UNSUBSCRIBE ME!
I have been emailing you guys for over a week to unsubcribe me. PLEASE CEASE 
AND DESIST FROM SENDING ME MORE MAILINGS FROM THIS LIST!

 
font color=redPlease visit our websites at/font
http://www.geocities.com/evan_j_siegel'http://www.geocities.com/evan_j_siegel;http://www.geocities.com/evan_j_siegel
and
http://www.qlineorientalist.com/IranRises'http://www.qlineorientalist.com/IranRises;http://www.qlineorientalist.com/IranRises
Thank you.





From: Yagnesh Chawda yagnesh.cha...@gmail.com
To: users@tomcat.apache.org
Sent: Mon, November 16, 2009 9:09:51 AM
Subject: Tomcat DBCP Connection Pooling to MySQL limited number of connection 
issue in Spring2.5 + Hibernate3 + commons-DBCP1.2


Hi,
  I am using Spring 2.5, Hibernate 3 and MySQL (5.0.45 (32 Bit), 5.0.84(64
Bit)) with commons-DBCP 1.2 in Tomcat-5.5

My issue is that even after specifying Connection pool of initialSize=40
and minIdle=35, my App. server is never keep only 9 connections open under
zero load condition. What I could figure out from the MySQL log was that,
server did created 40 connections, but also dropped each connection in 1-2
seconds after connection started. I have max_connection=200 in MySQL, and
time to keep idle connection in MySQL is also 8Hrs. 
  
Under load, App server creates connections upto 95 as I have described
it as maxActive=95
I confirmed it thru show global status and show processlist on MySQL
prompt while simulating a heavy traffic thru JMeter.

I tried with c3p0 from Hibernate, but no luck. Outcome is exactly same.
So am wondering what the issue is ??

My bean definition is as follows for DBCP:


bean id=dataSource destroy-method=close
class=org.apache.commons.dbcp.BasicDataSource
!--property name=driverClassName
value=com.mysql.jdbc.jdbc2.optional.MysqlDataSource/
property name=url value=${db.url}/
property name=username value=${db.user}/
property name=password value=${db.pass}/
property name=initialSize value=40/
property name=minIdle value=35/
property name=maxActive value=95/
property name=maxWait value=2/ --
/bean



!-- Hibernate related Beans definition starts here --
bean  id=sessionFactory
  
class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
   property name=dataSource ref=dataSource /


   property name=annotatedClasses
   list
 valuecom.domain.Company/value
 valuecom.domain.Country/value
   /list
   /property
   property name=hibernateProperties
props
prop key=hibernate.show_sqlfalse/prop
prop key=hibernate.format_sqlfalse/prop
prop 
key=hibernate.dialectorg.hibernate.dialect.MySQLDialect/prop
prop
key=hibernate.transaction.factory_classorg.hibernate.transaction.JDBCTransactionFactory/prop

prop
key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
prop
key=hibernate.cache.provider_configuration_file_resource_pathmy-ehcache.xml/prop
prop key=hibernate.cache.use_structured_entriestrue/prop
prop key=hibernate.cache.use_second_level_cachetrue/prop
prop key=hibernate.cache.use_query_cachetrue/prop
prop key=hibernate.default_batch_fetch_size30/prop
prop key=hibernate.jdbc.batch_size30/prop
prop key=hibernate.generate_statisticstrue/prop
prop key=hibernate.order_updatestrue/prop
prop key=hibernate.connection.release_modeauto/prop
/props
   /property
/bean

-- 
View this message in context: 
http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26372475.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

Re: OT: GoDaddy Hosting and Tomcat

2009-05-02 Thread Evan Siegel
This posting raises a question I've long had: What JSP-friendly hosts are to be 
recommended. I did some searching and came up with a large number of helpful 
sites, but I'd like to poll the list members on the matter.See the following:
http://www.hosting-review.com/hosting-directory/top-10-lists/Top-JSP-Hosting-Companies.shtml
I'm seriously consideringhttp://hostpapa.com/hr_offer_green.shtml
Thank you.

Please visit our website at
http://www.geocities.com/evan_j_siegel
Thank you.

--- On Mon, 4/27/09, George Sexton geor...@mhsoftware.com wrote:

From: George Sexton geor...@mhsoftware.com
Subject: OT: GoDaddy Hosting and Tomcat
To: Tomcat Users List users@tomcat.apache.org
Date: Monday, April 27, 2009, 10:44 AM

I thought I'd write up my experiences trying to get a servlet
application running on GoDaddy. Perhaps it will save someone else some pain.

I have a Java Servlet calendar application. It's a stable app and I've
got at least a thousand of running copies. I was attempting to install
it on GoDaddy's shared Linux hosting service which runs Tomcat 5.0.27.

Reading the documentation on their site, it looked like all I had to do
was upload the WAR file and wait until 1:00 AM Arizona time and the
application should be deployed. I did this and waited. The next day, I
found the application had not deployed. A call to technical support
revealed that I had to go to a certain corner of the hosting control
panel and enable Java language support. I did that and waited until the
next day.

This is one of the problems with their shared hosting account. ANY
change takes until the next day to take effect.

The next day, I looked, and the WAR file had been exploded but my App
didn't work. Since my App has a dependency on the database, I uploaded a
simple JSP to test the DB Connection. It worked. Attempts to view the
error logs failed.

I called GoDaddy support. The technician told me I need to enable error
logging. He walked me through the control panel and I enabled error
logging. I waited until the next day.

The application still didn't work. When I tried to view the error logs,
I got nothing. Another call to technical support revealed that the error
logs I had enabled would not actually contain any Tomcat log data.

I had my call escalated to a manager. I explained to him the reason I
knew my application was not working. I told him the login page was not
available. His response was Yeah, there's no file with that name. I
told him that the URL was a virtual mapping created in the web.xml file.
After literally an hour, they came back on-line and told me that they
were going to open a trouble-ticket and call me back.

Several hours later, I got an Email from support saying. It doesn't
work because there's no file with that name.

At this point, I had a funny feeling. I created a simple WAR file with
one servlet and a web.xml deployment descriptor. The deployment
descriptor mapped three URLs to the servlet:

/MapTest.xyz
/MapTest.jsp
/MapTest.html

I waited until the next day. Sure enough, I could access MapTest.xyz,
and MapTest.jsp. Attempts to access MapTest.html generated a 404 Not
Found error. This explains why my application was not running. All my
servlets are mapped into URLs with extension of .html. This was a design
decision because customers generally want the maximum visibility to
search engines.

So, what I found is that GoDaddy.com does not pass all requests into the
servlet container. It attempts to service as many requests with Apache
first, and then only passes the non-mapped requests into Tomcat. There
are some 50 file extensions GoDaddy co-opts including .css, .xml, and .js.

This configuration actually causes their deployment of Tomcat to be
non-compliant with the Servlet API version 2.3 specification. Section
SRV.11.2.1 says that explicit mappings in the deployment descriptor must take 
precedence over implicit mappings. Taken as a SYSTEM, their
deployment of Apache Tomcat is non-compliant.

My feeling is that ANY request that maps to a deployed context must be
passed to the servlet container. Clearly, they are not doing that.

So, after all the effort, I get to tell the customer that my application
will not work on their hosting account. Rats.

In general, even if your application isn't using servlet mapping I can't
recommend them. Since it takes until the next day before you can
re-deploy a WAR file, and there are no Tomcat logs available, it would
be a really rotten experience.


-- George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org