Problem starting connection pooling
I'm very new to MySQL, Tomcat, connection pooling, JSP, etc. and I've been banging my head against a wall for two weeks trying to get a simple program to connect to a MySQL database. *Vital Stats:* Ubuntu 9.10, Java 1.6.0_0, Java Servelet 2.5, Java Server Pages 2.1, JSTL 1.2, Apache2, Tomcat 6.0.20, MySQL 5.1.41 5.0.67 MySQL Connector/J 5.1.11 (also 5.1.10) - in $CATALINA_HOME/lib dbcp 1.2.1 - in $CATALINA_HOME/lib (all standard Ubuntu issue) *testapp/WEB-INF/web.xml:* ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5 description Servlet and JSP Examples. /description display-nameServlet and JSP Examples/display-name resource-ref descriptionDB Connection/description res-ref-namejdbc/mydatabase/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app *testapp/META-INF/context.xml:* ?xml version=1.0 encoding=UTF-8? Context Resource name=jdbc/mydatabase auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=foo password=bar driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://test.hostname.com:3306/database_test1/ /Context *testapp/testapp.jsp:* %@ page contentType=text/html % %-- These libraries are required for the c and sql tags --% %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jsp/jstl/sql; % meta http-equiv=Content-Type content=text/html; charset=UTF-8 html head titleJNDI DBCP Test Page/title /head body h1JNDI DBCP Test Page/h1 br/Executing the query ... br/ %-- Note: Enter a query that is valid for your database here --% sql:query var=result dataSource=jdbc/mydatabase SELECT company FROM manuals /sql:query /body /html I create the WAR (jar cvf testapp.war *), undeploy the old version and redeploy the new one through Tomcat Web Application Manager. Then restart Tomcat (sudo /etc/init.d/tomcat restart). The result is: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source) at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:188) at org.apache.jsp.test_jsp._jspService(test_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Blah, Blah, Blah *More info: *The connection to MySQL tested successfully using the command line 'mysql'. There are no firewalls, that I can find, between the servers. What is going on here? What am I missing? What is going on here? How do I fix it? -Do I need to create a foo user in the tomcat-users.xml? -Do I have to mess with the policy files? or security? Thanks for your help. Mark No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.432 / Virus Database: 271.1.1/2636 - Release Date: 01/21/10 07:34:00 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Problem starting connection pooling
On Jan 22, 2010, at 10:21 AM, Mark Witczak wrote: [snip] I create the WAR (jar cvf testapp.war *), undeploy the old version and redeploy the new one through Tomcat Web Application Manager. Then restart Tomcat (sudo /etc/init.d/tomcat restart). The result is: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source) at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:188) at org.apache.jsp.test_jsp._jspService(test_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Blah, Blah, Blah More info: The connection to MySQL tested successfully using the command line 'mysql'. There are no firewalls, that I can find, between the servers. Mark, What message is where you posted blah blah blah. *Usually* there's information from the driver right there, which will have the details of why there was a communications link failure. If I had to guess, your mysql server was started with --skip-networking (most debian-based distributions do this by default), and mysql is using unix domain sockets (which Java can't) to speak to mysqld. If that's the case, you'll have to reconfigure mysqld to listen at least on the loopback (127.0.0.1) by removing --skip-networking from my.cnf and adding --bind-address=127.0.0.1 -Mark -- Mark Matthews, Architect - Enterprise Tools MySQL @ Sun Microsystems, Inc., http://www.sun.com/mysql/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Problem starting connection pooling
Alright, here is the entire log entry: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNe stedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any pack ets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source) at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:188) at org.apache.jsp.test_jsp._jspService(test_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:537) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:636) Also, the MySQL instance I'm connecting to is hosted by dreamhost. I don't have any control over their networking configuration. Is there a command that will tell me if the --skip-networking flag was used for startup? On 1/22/2010 11:38 AM, Mark Matthews wrote: On Jan 22, 2010, at 10:21 AM, Mark Witczak wrote: [snip] I create the WAR (jar cvf testapp.war *), undeploy the old version and redeploy the new one through Tomcat Web Application Manager. Then restart Tomcat (sudo /etc/init.d/tomcat restart). The result is: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source)
Re: Problem starting connection pooling
On Jan 22, 2010, at 10:49 AM, Mark Witczak wrote: Alright, here is the entire log entry: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNe stedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any pack ets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source) at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:188) at org.apache.jsp.test_jsp._jspService(test_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:537) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:636) Also, the MySQL instance I'm connecting to is hosted by dreamhost. I don't have any control over their networking configuration. Is there a command that will tell me if the --skip-networking flag was used for startup? Mark, In mysql, issuing show variables like 'skip_networking' should tell you. -Mark -- Mark Matthews, Architect - Enterprise Tools MySQL @ Sun Microsystems, Inc., http://www.sun.com/mysql/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Problem starting connection pooling
skip-networking is OFF On 1/22/2010 12:09 PM, Mark Matthews wrote: On Jan 22, 2010, at 10:49 AM, Mark Witczak wrote: Alright, here is the entire log entry: Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jan 21, 2010 9:40:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 21, 2010 9:43:06 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: org.apache.commons.dbcp.SQLNe stedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any pack ets from the server.) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source) at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source) at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:188) at org.apache.jsp.test_jsp._jspService(test_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:537) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:636) Also, the MySQL instance I'm connecting to is hosted by dreamhost. I don't have any control over their networking configuration. Is there a command that will tell me if the --skip-networking flag was used for startup? Mark, In mysql, issuing show variables like 'skip_networking' should tell you. -Mark No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.432 / Virus Database: 271.1.1/2638 - Release Date: 01/22/10 07:34:00
Connection Pooling with mysql-5.1.11-beta-linux-i686
Greetings all, I'm working with mysql-5.1.11-beta-linux-i686 set up using the NDB cluster. I was wondering if there are any limitations or inefficiencies if I was to use a connection pool to the mysql server(s) front-ending the cluster? Several processes will make a request of our server and then it will use a mysql connection from the pool to fulfill its request. I've heard of inefficiencies regarding idle connections (like the unused ones in our pool) and was wondering how much truth there is to that and the details surrounding it. Thank you for any assistance, Rob Emanuele -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connection Pooling
Has anyone implemented connection pooling in C# .NET? On 5/8/06, romyd misc [EMAIL PROTECTED] wrote: What i meant by implementing connection pooling i meant if i need to do any code changes other than changes in connection string. Thanks, Romy On 5/8/06, Tim Lucia [EMAIL PROTECTED] wrote: I don't hear you need to implement connection pooling. Maybe, but I think you might still have errors under load, as you approach the maximum connection count in the pool. Tim -Original Message- From: romyd misc [mailto:[EMAIL PROTECTED] ] Sent: Monday, May 08, 2006 2:37 PM To: mysql@lists.mysql.com Subject: Connection Pooling Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy
Connection Pooling
Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy
RE: Connection Pooling
I don't hear you need to implement connection pooling. Maybe, but I think you might still have errors under load, as you approach the maximum connection count in the pool. Tim -Original Message- From: romyd misc [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:37 PM To: mysql@lists.mysql.com Subject: Connection Pooling Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connection Pooling
romyd misc said: Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy Your comment about one connection for all of the threads disturbs me. Your application will have to ensure that each thread is finished with the connection and returns it to the pool. Two threads cannot, at the same time, use the same connection. Say thread A had performed a select which returned 2000 row resultset. Until that thread had read in all 2000 rows, they would still be in the connection. If thread B tried to use the same connection and asked for a different result set when thread A went back for the rest of its results where would they be? When you put stress on your application this is more likely to happen. What a pool does is allow your threads to formally release their connections back to the pool when they are done with them and re-aquire them later without the full overhead to going all the way back to the server to open a connection. Instead you go to some intermediate point where a set of threads are already avaiable (in Apache its at the child level and in java its at the container level). Bill -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connection Pooling
What i meant by implementing connection pooling i meant if i need to do any code changes other than changes in connection string. Thanks, Romy On 5/8/06, Tim Lucia [EMAIL PROTECTED] wrote: I don't hear you need to implement connection pooling. Maybe, but I think you might still have errors under load, as you approach the maximum connection count in the pool. Tim -Original Message- From: romyd misc [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:37 PM To: mysql@lists.mysql.com Subject: Connection Pooling Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy
RE: Connection Pooling
It sounds like you need to either synchronize access to 'the connection' (one user at a time), or have a connection per request. In the latter case, obtaining a connection from a pool of connections makes sense. Unfortunately, I have only done this with Java -- not with .NET. I would be surprised, however, if you had to do anything special, other then connecting via a pooling connection string. In the Java case, connection.close() is overridden to simply return the connection to the pool (and .open() borrows one, ...) Tim -Original Message- From: romyd misc [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 4:33 PM To: Tim Lucia Cc: mysql@lists.mysql.com Subject: Re: Connection Pooling What i meant by implementing connection pooling i meant if i need to do any code changes other than changes in connection string. Thanks, Romy On 5/8/06, Tim Lucia [EMAIL PROTECTED] wrote: I don't hear you need to implement connection pooling. Maybe, but I think you might still have errors under load, as you approach the maximum connection count in the pool. Tim -Original Message- From: romyd misc [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:37 PM To: mysql@lists.mysql.com Subject: Connection Pooling Hi Everyone, I'm developing an application using C# .NET and mysql as database. It's a multithreaded application, we open a mysql database connection at the very beginning when the application is started and all the database requests use the same connection. But under stress or when more than one request try to access database, i get object reference errors. I don't get this error when frequency of database calls is low. Does it sounds like i need to implement connection pooling? I tried to lookup online, but couldn't find any help under mysql documentation. Can someone help me setting up mysql connection pooling with C#.NET. Thanks in advance, Romy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Table Lock Delays and Connection Pooling
Hi all , I have a quick question regarding table locking. This is a snippet referring to when table locking is disadvantageous: Another client issues another SELECT statement on the same table. Because UPDATE has higher priority than SELECT, this SELECT will wait for the UPDATE to finish. It will also wait for the first SELECT to finish! So what constitutes a new client exactly? We use Perl and DBI to connect to MySQL. Does this mean that everytime we connect to the DBase it is considered a new client? If so , would some form of connection pooling/caching help reduce the lock delays on a slow SELECT statement? Thanks ! Aaron
Re: Table Lock Delays and Connection Pooling
Every new connection is considered a client. It's a bad idea to try to do your own scheduling client side to try to defeat table locks because MySQL can proceed with other clients as soon as the locks are freed vs your application waiting for a complete result set to return before proceeding with another query from a different client. Not to mention the over head of scheduling on the client side. If you have enough lock contention for table locks to be a problem you should switch to the InnoDB storage engine. -- Eric Bergen [EMAIL PROTECTED] On Mon, 18 Oct 2004 16:58:04 -0700, Aaron [EMAIL PROTECTED] wrote: Hi all , I have a quick question regarding table locking. This is a snippet referring to when table locking is disadvantageous: Another client issues another SELECT statement on the same table. Because UPDATE has higher priority than SELECT, this SELECT will wait for the UPDATE to finish. It will also wait for the first SELECT to finish! So what constitutes a new client exactly? We use Perl and DBI to connect to MySQL. Does this mean that everytime we connect to the DBase it is considered a new client? If so , would some form of connection pooling/caching help reduce the lock delays on a slow SELECT statement? Thanks ! Aaron -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Desperate here: Connection error 08000 and Connection Pooling
Hi folks, Im dying here slowly. Can anyone tell me what an = SqlState 08000 (connection exception) REALLY MEANS Is it as obvious = as I think it is, Im NOT CONNECTED to MySQL, and if so, why not = 08003 (connection does not exist)... I have a major problem, Im running Windows 2000 Server, MySql v = 4.1.3b-beta-nt, ConnectorJ v 3.0.11-stable-bin and running Servlets on = Tomcat v 5.0.27 and attempting to run Connection Pooling. PLEASE, if anyone is running this sort of configuration, email me = directly at [EMAIL PROTECTED], I desperately need some minor help, = I been wallowing in this quagmire for 2 weeks to no avail.. And Im = sure its just something simple.. Thank you to anyone kind enuf to help me Mike
Connection pooling with C?
I have an app I'm using (I have source, but I'm not the programmer), that works pretty good, but it seems to be speed-limited because of the time to connect to the mysql server. I run with IP's only, no DNS lookups and such, and things are better, but I think it could improve. Is there a C based connection pooling thingamabob I can use, like mysql_pconnect, and some external demon of some kind to assist? Thanks in advance for any help. I can find tons of stuff for perl/web based stuff, but I need it for C. Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Tomcat, Connection Pooling, and MySQL
you need to put mysql-connector-javax in tomcat/common/lib and then specify parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter in your server.xml Adam On 10/03/2003 04:35 PM Dan Greene wrote: I got it working... unfournately it's on my laptop at home, not here at work with me I think that the issues was that the class names given in the documentation for the jdbc driver for MySQL were wrong look at the listing of the contents of the jar file, and see if you can find the right one... Sorry that I'm being incredibly vague I set it up months ago Dan Greene -Original Message- From: Steven Nakhla [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 9:42 AM To: MySQL Subject: Tomcat, Connection Pooling, and MySQL Has anyone managed to setup Tomcat to use MySQL for database connection pooling? I've found this document which gives information on it: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasourc e-examples-howto.html However, when I try and run it I get messages about not being able to find the hsql driver class. From searching on Google, it seems that this is a common error, but there are no solutions posted. Has anyone managed to get it up and running successfully? I'd really appreciate any advice! Thanks! Steve Nakhla - Do you Yahoo!? The New Yahoo! Shopping - with improved product search -- Running mySQL 4.1.0 on Linux 2.4.20 RH9 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Tomcat, Connection Pooling, and MySQL
Has anyone managed to setup Tomcat to use MySQL for database connection pooling? I've found this document which gives information on it: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html However, when I try and run it I get messages about not being able to find the hsql driver class. From searching on Google, it seems that this is a common error, but there are no solutions posted. Has anyone managed to get it up and running successfully? I'd really appreciate any advice! Thanks! Steve Nakhla - Do you Yahoo!? The New Yahoo! Shopping - with improved product search
RE: Tomcat, Connection Pooling, and MySQL
I got it working... unfournately it's on my laptop at home, not here at work with me I think that the issues was that the class names given in the documentation for the jdbc driver for MySQL were wrong look at the listing of the contents of the jar file, and see if you can find the right one... Sorry that I'm being incredibly vague I set it up months ago Dan Greene -Original Message- From: Steven Nakhla [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 9:42 AM To: MySQL Subject: Tomcat, Connection Pooling, and MySQL Has anyone managed to setup Tomcat to use MySQL for database connection pooling? I've found this document which gives information on it: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasourc e-examples-howto.html However, when I try and run it I get messages about not being able to find the hsql driver class. From searching on Google, it seems that this is a common error, but there are no solutions posted. Has anyone managed to get it up and running successfully? I'd really appreciate any advice! Thanks! Steve Nakhla - Do you Yahoo!? The New Yahoo! Shopping - with improved product search -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
MySql JDBC connection pooling in Websphere
I have configured WAS Express 5.0 to connect to MySql 4.0, however I am unable to open any connections. I know that the connection to the MySql server works, because if I change any of the connection parameters (port, database name, login), the JDBC driver returns the appropriate error message. I have tried using both the MySql Connector 2.0.14 and 3.0.3 JDBC drivers to connect. Within WAS 5.0, I have created a user-defined JDBC provider and my datasource uses the com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper data source helper class. The error I get is listed below (this was using MySql Connector 2.0.14). I get a similar error using 3.0.3, but that makes sense because the beta documentation states that Connection.getTypeMap() has not been implemented. Does anyone have any ideas as to what could be going on here? Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/raytheon, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: null. at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataStoreAdapterException.java:251) at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataStoreAdapterException.java:172) at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataStoreAdapterException.java:125) at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.initializeConnectionProperties(WSRdbManagedConnectionImpl.java:584) at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.init(WSRdbManagedConnectionImpl.java:359) at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:506) at com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1106) at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:897) at com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1065) at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:560) at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:374) at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:205) at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:180) at com.ds.data.ConnectionManager.getConnection(ConnectionManager.java:51) at com.ds.business.navigation.NavControl.init(NavControl.java:57) at com.ds.business.navigation.NavControl.init(NavControl.java:40) at com.ds.business.util.AppSettings.init(AppSettings.java:33) at com.ds.presentation.util.Application.init(Application.java:25) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147) at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113) at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:175) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:761) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:257) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:453) at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:133) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:401) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:743) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:337) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:531) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:254) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:232) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343) at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234) at
Re: MySql JDBC connection pooling in Websphere
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom O'Neil wrote: I have configured WAS Express 5.0 to connect to MySql 4.0, however I am unable to open any connections. I know that the connection to the MySql server works, because if I change any of the connection parameters (port, database name, login), the JDBC driver returns the appropriate error message. I have tried using both the MySql Connector 2.0.14 and 3.0.3 JDBC drivers to connect. Within WAS 5.0, I have created a user-defined JDBC provider and my datasource uses the com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper data source helper class. The error I get is listed below (this was using MySql Connector 2.0.14). I get a similar error using 3.0.3, but that makes sense because the beta documentation states that Connection.getTypeMap() has not been implemented. Does anyone have any ideas as to what could be going on here? As far as I can tell, this is a bug in WebSphere's connection pooling classes, because getTypeMap() is not required to be implemented (by the JDBC spec. You can try returning an empty java.util.HashMap() from that method and see if that makes your connection pool work. If so, I can add that feature to the driver for version 3.0.5. -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+GyIYtvXNTca6JD8RAp1kAJ9E0j4oW296om2LeDn1GlcJ5MQngQCgnYC6 sSH0miw2H2Ymn7cyS8Hi9Wc= =t3hW -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC Connection Pooling Not Quite Right?
sql, query ... just to make the filter happy. on 11/8/02 2:30 AM, [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: You are missing something, I am afraid. To quite Sun's Javadoc for the PooledConnection class Thank you so much for the quick reply. Now I understand why the implementation of pooled connections seemed so lame (why on earth did JDBC client code need to get a different kind of connection?). Strikes me that it's just as ridiculous that I have to implement the pooling scheme. It would have made more sense to provide a reasonable pooling scheme and allowed me to add my own, if I so desired. In any event, thank you. Now I know how to fix the problem! The Java list - [EMAIL PROTECTED] - would probaby be more appropriate than the general list, but otherwise this is the right place. Perhaps that should be mentioned on the Connector/J pages...I had no idea such a list existed. Thanks! -- Rick - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC Connection Pooling Not Quite Right?
Rick Mann wrote: sql, query ... just to make the filter happy. on 11/8/02 2:30 AM, [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote: You are missing something, I am afraid. To quite Sun's Javadoc for the PooledConnection class Thank you so much for the quick reply. Now I understand why the implementation of pooled connections seemed so lame (why on earth did JDBC client code need to get a different kind of connection?). Strikes me that it's just as ridiculous that I have to implement the pooling scheme. It would have made more sense to provide a reasonable pooling scheme and allowed me to add my own, if I so desired. Not in Sun's eyes. They figure (rightly or wrongly) that no one runs server-side Java outside of some application server. So they don't spend time specifying a 'standard' connection pool, because that's 'vendor' specific...instead they specify a contract between a JDBC driver and an application server to provide connection pooling. On the other hand, you don't need to re-invent the wheel either. There is a lot of open source connection pooling code out there. The one I'm currently recommending (as it sees the most current development) is DBCP from the Apache Jakarta Commons project: http://jakarta.apache.org/commons/dbcp.html In any event, thank you. Now I know how to fix the problem! The Java list - [EMAIL PROTECTED] - would probaby be more appropriate than the general list, but otherwise this is the right place. Perhaps that should be mentioned on the Connector/J pages...I had no idea such a list existed. Thanks! I'll forward the request to our web team. It is mentioned at the bottom of the README for the driver, however :) -Mark -- For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
JDBC Connection Pooling Not Quite Right?
Hi. I hope this is the right place to discuss this, now that the drivers are part of the official MySQL stuff. If not, please let me know where I should post this. Thanks. I've been using the 2.0.14 version of the drivers, and just recently switched to using the pooled connections supplied by JDBC 2.0. What I noticed was that I'm still creating many connections. For example, I did an operation in my web app that makes about 30 connections, and the number of connections opened in MySQL (which I had just recently restarted) jumped from 200 to 231. So, I went digging through the JDBC code, and found that every time the PooldedDataSource returns a new PooledConnection, with a new physical Connection obtained from the non-pooled DataSource. No where can I find the actual pool in which the pooledConnections are kept. Am I completely missing something, and there some other thing I need to do, or is this how it's supposed to be, or (most likely, I think), is there a serious flaw in the MySQL JDBC drivers? TIA, -- Rick - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC Connection Pooling Not Quite Right?
Hi, Rick, Hi. I hope this is the right place to discuss this, now that the drivers are part of the official MySQL stuff. If not, please let me know where I should post this. Thanks. The Java list - [EMAIL PROTECTED] - would probaby be more appropriate than the general list, but otherwise this is the right place. I've been using the 2.0.14 version of the drivers, and just recently switched to using the pooled connections supplied by JDBC 2.0. What I noticed was that I'm still creating many connections. For example, I did an operation in my web app that makes about 30 connections, and the number of connections opened in MySQL (which I had just recently restarted) jumped from 200 to 231. So, I went digging through the JDBC code, and found that every time the PooldedDataSource returns a new PooledConnection, with a new physical Connection obtained from the non-pooled DataSource. No where can I find the actual pool in which the pooledConnections are kept. Am I completely missing something, and there some other thing I need to do, or is this how it's supposed to be, or (most likely, I think), is there a serious flaw in the MySQL JDBC drivers? You are missing something, I am afraid. To quite Sun's Javadoc for the PooledConnection class An object that provides hooks for connection pool management. A PooledConnection object represents a physical connection to a data source. The connection can be recycled rather than being closed when an application is finished with it, thus reducing the number of connections that need to be made. An application programmer does not use the PooledConnection interface directly; rather, it is used by a middle tier infrastructure that manages the pooling of connections. You need to obtain or write a Pool Manager. Application code then calls PoolManager.getConnection () instead of creating a new connection, but otherwise runs unchanged. When the application calls Connection.close(, the PoolManager is informed and can take appropriate recycling action (releasing any resultsets, adding to a pool of available connections, deleting long-unused connections before MySQL gets bored of them ). Alec Cawley - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: InnoDB transactions with Connection Pooling
On Mon, Apr 22, 2002 at 09:02:54AM +0300, Heikki Tuuri wrote: Mark, if you do not explicitly do SET AUTOCOMMIT=0 then MySQL automatically calls COMMIT after every SQL statement. Make that: SET AUTOCOMMIT=1 Heikki is probably low on coffee. :-) Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.47-max: up 73 days, processed 1,941,489,847 queries (304/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: InnoDB transactions with Connection Pooling
Jeremy, - Original Message - From: Jeremy Zawodny [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, April 22, 2002 9:37 AM Subject: Re: InnoDB transactions with Connection Pooling On Mon, Apr 22, 2002 at 09:02:54AM +0300, Heikki Tuuri wrote: Mark, if you do not explicitly do SET AUTOCOMMIT=0 then MySQL automatically calls COMMIT after every SQL statement. Make that: SET AUTOCOMMIT=1 MySQL has AUTOCOMMIT=1 as the default. Thus if you do not explicitly change the value with SET AUTOCOMMIT=0, then MySQL calls commit after each SQL statement. Heikki is probably low on coffee. :-) Jeremy, it is midnight there, morning here :). Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.47-max: up 73 days, processed 1,941,489,847 queries (304/sec. avg) Regards, Heikki - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: InnoDB transactions with Connection Pooling
Mark, if you do not explicitly do SET AUTOCOMMIT=0 then MySQL automatically calls COMMIT after every SQL statement. If you set AUTOCOMMIT=0, then you should yourself call COMMIT after each SELECT so that you do not leave a dangling transaction open in the database and that you get a fresh snapshot of the database in each consistent read. Best regards, Heikki Tuuri Innobase Oy --- InnoDB - transactions, row level locking, and foreign key support for MySQL See http://www.innodb.com, download MySQL-Max from http://www.mysql.com - Original Message - From: Mark Hazen [EMAIL PROTECTED] Newsgroups: mailing.database.mysql Sent: Monday, April 22, 2002 3:35 AM Subject: InnoDB transactions with Connection Pooling Fellow MySQL gurus, I am using Apache::DBI to accomplish connection pooling. I am working with an InnoDB table that gets updated very frequently. My question is this: Since my connections are pooled and stay open for days at a time, am I essentially always going to read from that connection the same version of the database (even from request to request). My guess is yes and that I would need to do a COMMIT before every request (or after). Maybe someone can shed some light on this... Example: Table innodb_test has 2 rows. Connection ID 1, Apache Request 1 SELECT * FROM innodb_test; It spits back 2 rows. Then some other thread adds 3 rows to the table, and COMMITs them. Connection ID 1, Apache Request 2 (notice that it is the same connection, just a new web page request) SELECT * FROM innodb_test; My guess is that it would spit back the same 2 rows again and not 5. I would need to do a COMMIT either before or after each request. Is this right? Does anyone have an opinion on whether I should do it after or before. I would assume after because the request could then already be served to the user (I don't need up-to-the-picosecond results). Thanks! Mark - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Connection Pooling (closing of connections)
Hi, I'm using JDBC/MySQL and the MM.MySQL driver to build JSP pages.the application is deployed in tomcat.I am using connection pooling package in my application.i am able to create a pool when the first user logs in.kindly advice how i can close or destroy the connections when the server is shut down. i am not using a servlet in my application. Kindly advice how this can be done. Thanking you Gaurav Tuli
Connection Pooling(closing)
Hi, I'm using JDBC/MySQL and the MM.MySQL driver to build JSP pages.the application is deployed in tomcat.I am using connection pooling package in my application.i am able to create a pool when the first user logs in.kindly advice how i can close or destroy the connections when the server is shut down.The package i am using has a facility to destroy the connection.how can i call this destroy method before shutting down the server. i am not using a servlet in my application. Kindly advice how this can be done. Thanking you Gaurav Tuli
Connection Pooling
Hi, I'm using JDBC/MySQL and the MM.MySQL driver to build JSP pages.I want to use connection pooling in my application.Kindly advice connection pooling package which is suitable for the above application. Thanking You, Gaurav Tuli
RE: Connection Pooling
Try going to www.freshmeat.net and searching for PoolMan. It's a Java library for pooling connections to MySQL. I haven't messed around with it but I saw it when trying to learn Java. Hope this helps, Jamie -Original Message- From: gaurav [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 12:33 AM To: [EMAIL PROTECTED] Subject: Connection Pooling Hi, I'm using JDBC/MySQL and the MM.MySQL driver to build JSP pages.I want to use connection pooling in my application.Kindly advice connection pooling package which is suitable for the above application. Thanking You, Gaurav Tuli - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php