Jump to content
We've recently updated our Privacy Statement, available here ×

How to set maximum number of jdbc-connection to datasource


suhov_vb
Go to solution Solved by suhov_vb,

Recommended Posts

We use JasperReports Server Community Edition (v. 5.2). We use jdbc source in our reports. I noticed that JasperServer opens maximum 5 connections to the source and next attempts to open a connection wait for connection release. I'd like to increase that limit. I tried to follow next document:

http://community.jaspersoft.com/wiki/how-tune-number-connections-server-database-pool

But changes to context.xml (and restart tomcat) didn't affect on the number of opening connections.

Please help us to set it.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You just need to increase the number of jdbc connections used in a pool.

But how to do it? I tried to control it via maxActive parameter of the Resource element in the /etc/tomcat6/Catalina/localhost/jasperserver.xml and /META-INF/context.xml in JasperServer install dir. Both didn't work.

Link to comment
Share on other sites

  • Solution

I solved the problem. There are 2 possible answers:

1. Change DataSource pool size parameter (second argument) of dataSourceObjectPoolFactory bean constructor in /jasperserver/WEB-INF/applicationContext.xml file (default is 5):

    <bean id="dataSourceObjectPoolFactory" class="org.apache.commons.pool.impl.GenericObjectPoolFactory">
        <constructor-arg type="org.apache.commons.pool.PoolableObjectFactory"><null/></constructor-arg>
        <constructor-arg type="int" value="15"/>
    </bean>

Reload application after saving changes.

2. Use JNDI source instead of JDBC source and set JNDI connection following JasperReports Server Admin Guide or Appache Tomcat documentation: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...