[Mondrian] connection issues with mondrianOlap4j

Julian Hyde jhyde at pentaho.com
Wed Jun 8 15:57:06 EDT 2011

Sounds like JDBC connections are being taken from the connection pool but
not returned. The pool is finite: there can be no more than N open
connections at a time. When they ask for connection N+1 it will block and
eventually time out.

The connection leak is likely to be in Mondrian's code, and not your fault.
Likely there is an error and Mondrian is not returning the connection to the

Keeping olap4j connections open shouldn't be the problem. Mondrian does not
keep JDBC connections open for the duration of an olap4j connection -- it
opens & closes them (more precisely borrows & returns them) for each access
to the database.

Please log a bug with a testcase. Or maybe there's tracing in dbcp you can
enable to show the callstack for each of the still-open connections.


> -----Original Message-----
> From: mondrian-bounces at pentaho.org 
> [mailto:mondrian-bounces at pentaho.org] On Behalf Of Paul Stoellberger
> Sent: Wednesday, June 08, 2011 10:12 AM
> To: olap4j-devel at lists.sourceforge.net; Mondrian developer 
> mailing list
> Subject: [Mondrian] connection issues with mondrianOlap4j
> Hi,
> since quite a while we are experiencing very strange 
> behaviour on our demo.
> At some point olap4j / mondrian cant execute any queries anymore.
> We were initially using normal jdbc based connections for 
> mondrian / olap4j. Which resulted in "freeze" behaviour 
> without any info in any log file what went wrong whenever 
> mondrian tried to execute something on the database
> Now with JNDI i get the following exception:
>         at 
> mondrian.rolap.RolapConnection.execute(RolapConnection.java:582)
>         ... 79 more
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot 
> get a connection, pool error Timeout waiting for idle object
>         at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(Poolin
> gDataSource.java:104)
>         at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDat
> aSource.java:880)
>         at mondrian.rolap.SqlStatement.execute(SqlStatement.java:123)
>         ... 90 more
> Caused by: java.util.NoSuchElementException: Timeout waiting 
> for idle object
>         at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Ge
> nericObjectPool.java:958)
>         at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(Poolin
> gDataSource.java:96)
>         ... 92 more
> In our workflow we create one olap4j connection on server 
> startup and use that to create new Query objects.
> We never close any connections, nor remove query objects that 
> are abandoned by users, we keep them indefinitely at the moment.
> I was looking at the log files and saw that the error 
> occurred suddenly, not after a timeout or something. There 
> was something successfully executed 5 mins before on the database.
> Mysql doesn't report anything on "SHOW PROCESSLIST", so i'm 
> assuming the connection pool is not exhausted from the DB 
> point of view, but rather because of mondrian.
> Is there anything in our workflow that could  cause mondrian 
> to behave like that?
> Does it not close its jdbc connections?
> This error occurs with both, mysql and hsqldb.
> I'm running out of ideas what i could do to fix or even debug 
> this issues.
> If anyone has any idea on what I could try, please step forward ;-)
> -Paul
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian

More information about the Mondrian mailing list