Announcement Announcement Module
Collapse
No announcement yet.
dbcp.BasicDataSource configuration advice sought Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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?

      Comment


      • #4
        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

        Comment

        Working...
        X