[Mondrian] [Olap4j-devel] connection issues with mondrianOlap4j
p.stoellberger at gmail.com
Fri Jun 10 14:06:20 EDT 2011
My JNDI looks like that.
No log entry whatsoever anywhere though :/
<Resource name="jdbc/Foodmart" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="40" maxIdle="10"
maxWait="10000" username="pentaho_user" password="password"
validationQuery="select count(*) from foodmart.store;"/>
On Jun 10, 2011, at 18:48 , Marc Batchelor wrote:
> If you can configure your connection using DBCP in Tomcat, the resource definition does in fact allow you to identify abandoned connections:
> Look at the logAbandoned, removeAbandoned, and removeAbandonedTimeout settings:
> <Resource name="jdbc/SampleData" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="5" maxWait="10000"
> username="pentaho_user" password="xxxxxx"
> driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/sampledata"
> validationQuery="/* ping */"
> What's nice is that when a connection is deemed abandoned, either by the reaping thread setup in the removeAbandonedTimeout, or when a finalizer kicks in on the connection instance, it will send to the log a stack dump of the code that grabbed the connection in the first place.
> -----Original Message-----
> From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Paul Stoellberger
> Sent: Friday, June 10, 2011 1:25 PM
> To: Julian Hyde
> Cc: olap4j-devel at lists.sourceforge.net; 'Mondrian developer mailing list'
> Subject: Re: [Mondrian] [Olap4j-devel] connection issues with mondrianOlap4j
> I was trying all afternoon to come up with a Testcase or even figure out how I could get more debug info from DBCP / Mondrian.
> Unfortunately I was not successful at all.
> There is no logging in DBCP or mondrian regarding the pool.
> I think this issue is related to the internal Pool (RolapConnectionPool) since its happening to JDBC connection as well as JNDI.
> Any input on how I could debug / test it would be appreciated.
> Otherwise I need to file a bug without any more detailed info.
> On Jun 8, 2011, at 20:57 , Julian Hyde wrote:
>> 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 pool.
>> 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
>>> Subject: [Mondrian] connection issues with mondrianOlap4j
>>> since quite a while we are experiencing very strange behaviour on our
>>> 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:
>>> ... 79 more
>>> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a
>>> connection, pool error Timeout waiting for idle object
>>> at mondrian.rolap.SqlStatement.execute(SqlStatement.java:123)
>>> ... 90 more
>>> Caused by: java.util.NoSuchElementException: Timeout waiting for idle
>>> ... 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
>>> If anyone has any idea on what I could try, please step forward ;-)
>>> Mondrian mailing list
>>> Mondrian at pentaho.org
>> -------- EditLive Enterprise is the world's most technically advanced
>> content authoring tool. Experience the power of Track Changes, Inline
>> Image Editing and ensure content is compliant with Accessibility
>> olap4j-devel mailing list
>> olap4j-devel at lists.sourceforge.net
> Mondrian mailing list
> Mondrian at pentaho.org
> Mondrian mailing list
> Mondrian at pentaho.org
More information about the Mondrian