Results 1 to 4 of 4

Thread: dbcp.BasicDataSource configuration advice sought

  1. #1

    Default dbcp.BasicDataSource configuration advice sought

    I am using Spring with Hibernate and at the moment am using the following datasource configuration. I am looking for suggestions as to what I might want to change or add to achieve maximum performance in a production environment. I know there are many other factors that would affect such tuning decisions, but I was hoping for some advice on how to set up a good general initial configuration that would best handle a heavy load of light queries.


    Thanks for any help offered!

    Code:
    <bean id="dataSource"  class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName"
                value="com.mysql.jdbc.Driver" />
            <property name="url"  value="jdbc:mysql://localhost:3306/mysqldb?autoReconnect=true" />
            <property name="username" value="me" />
            <property name="password" value="mypass" />
            <property name="initialSize" value="10" />
            <property name="maxActive" value="100" />
    	<property name="maxIdle" value="-1" />
    	<property name="maxWait" value="-1" />
        </bean>

  2. #2
    Join Date
    Feb 2009
    Location
    London, UK
    Posts
    24

    Default

    I'd recommend you check out:

    http://vigilbose.blogspot.com/2009/0...mcat-jdbc.html
    and
    http://www.reverttoconsole.com/blog/java/dbcp-vs-c3p0/

    I came across some DBCP issues in a project last week, then noticed the open issues on their website and made the decision to switch to using c3p0.

    --
    Stephen Souness

  3. #3

    Default

    Thank you for those interesting articles. Very helpful. I got all excited about the tomcat jdbc connection pool idea but then at the bottom of the article I see that that is apparently only available with a license to SpringSource tc server, correct?

    Apparently c3p0 is touted for being better in multi threaded environments... I must admit I am a little confused..what production environment is not multi threaded?

  4. #4
    Join Date
    Feb 2009
    Location
    London, UK
    Posts
    24

    Default

    Check out:

    http://tomcat.apache.org/dev/dist/jd...a/v1.0.1-beta/

    I haven't tried it out, so would be curious to hear how you get on.


    --
    Stephen Souness

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •