On Fri, 2007-09-21 at 07:02 +0200, Charles Oliver Nutter wrote:
> Jens Kraemer wrote:
> > Hi,
> > 
> > I'm using ActiveRecord-JDBC-0.5 in a JRuby/Rails app I'd like to deploy
> > on JBoss (tried with 4.2.1, JDK 1.5).
> > 
> > I configured a jndi datasource pointing to an Oracle DB in JBoss which
> > I'm using from my Rails app. Everything appears to work, however JBoss
> > spits out the following error on every request:
> > 
> > INFO  [CachedConnectionManager] Closing a connection for you. Please close 
> > them yourself:
> > [EMAIL PROTECTED]
> > java.lang.Throwable: STACKTRACE
> > at 
> > org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
> > at 
> > org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
> > at 
> > org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
> > at 
> > org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 
> > is this a known issue (or is it an issue at all), and how could I close
> > the connection as JBoss tells me?
> 
> That's unusual...why would it want the connections to be closed after 
> each request anyway? They're supposed to be cached after all.

I get the same thing with derby; I've not had too much chance to look at
it yet -- I'm guessing it's endemic to the datasources.

I'm thinking that the connection is getting returned to the pool, but if
it's supposed to be cached, then that would be a bug.  

JBoss does have a flag in their datasource definition to check that
statements are closed when returned to the pool -- I've got it turned
off and am still seeing these messages.  That may be what is causing the
issue; it's expecting the statements to be closed and they're not. (just
did a quick gander of JdbcAdapterInternalService.java and at first
glance, it looks as though the statements are closed)


One thing which may be another "side-effect" would be that JBoss does
close unused connections after 5 minutes, but that seems to be for
shrinking the connection pool.

_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to