openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Wierd issue.
Date Thu, 24 May 2012 21:14:02 GMT
Hi Daniel,
Since you have several variables in play here, I'd try to narrow in on the
culprit.  How do you have your datasource defined?  Can you remove the
tomcat dbcp usage, for example?  Or, replace it with the Apache dbcp
implementation?  I don't see any issues with the code snippet you showed
below.  But, to be honest, I don't understand the need to wrap the results
in yet another ArrayList.  Are you saying that you get the same results
with or without this extra ArrayList instance?  I'd remove that as well
until you to the bottom of the connection closed issue.  I'm not seeing
anything that points directly at OpenJPA's connection usage, so I think we
need to narrow down the possibilities.

Good luck,
Kevin

On Thu, May 24, 2012 at 3:30 PM, Daniel Persson <mailto.woden@gmail.com>wrote:

> Hi.
>
> Still have an issue with Tomcat and the database connection handling.
> Perhaps this new discovery will bring some light into the problem.
>
> I now got an Error thrown with the following text:
>
> DBCP object created 2012-05-24 10:25:46 by the following code was never
> closed:
> java.lang.Exception
>        at
> org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:96)
>        at
> org.apache.tomcat.dbcp.dbcp.AbandonedTrace.<init>(AbandonedTrace.java:79)
>        at
>
> org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.<init>(DelegatingResultSet.java:71)
>        at
>
> org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.wrapResultSet(DelegatingResultSet.java:80)
>        at
>
> org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
>        at
>
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:267)
>        at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1144)
>        at
>
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:265)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1750)
>        at
>
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:255)
>        at
> org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
>        at
> org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
>        at
> org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
>        at
>
> org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
>        at
> org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
>        at
> org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
>        at
>
> org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
>        at
>
> org.apache.openjpa.datacache.QueryCacheStoreQuery$CachingResultObjectProvider.open(QueryCacheStoreQuery.java:644)
>        at
>
> org.apache.openjpa.lib.rop.WindowResultList.<init>(WindowResultList.java:57)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCFetchConfigurationImpl.newResultList(JDBCFetchConfigurationImpl.java:305)
>        at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
>        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
>        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
>        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
>        at
> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
>        at
> org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286)
>        at
> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
>
> And reading down the stacktrace I find my own code and the row with an
> error is as follows.
>
> TypedQuery<MyEntity> q = em.createQuery(SQL_STATEMENT, MyEntity.class);
> List<MyEntity> myNewList = new ArrayList(q.getResultList());
>
> The reason I create the new list is just for the issue at hand that the
> connection or result isn't released.
> The Values in this list will only be read and no more interaction from
> OpenJPA is required.
>
> Still it seems that the result list isn't released back to Tomcat. Any
> ideas?
>
> Best regards
>
> Daniel
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message