[Persistence, JBoss/CMP, Hibernate, Database] - JDBC: Closing a connection for you
by sascha242
Hi,
I've a question concerning JBoss and JDBC. We're generating reports using JExcel and JDBC. After generating one report (we receive the DB-connections using JNDI), the ConnectionManager seems to close the DB-connection. Do we have to close the connection manually and get a "fresh" connection from the pool?
Here is our Exception:
2008-03-27 19:22:07,501 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@11b6923
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 de.blb.rczl.onlinereports.common.report.BlbRcZlResourceManagerDefaultImpl.(BlbRcZlResourceManagerDefaultImpl.java:71)
at de.blb.rczl.onlinereports.common.report.BlbRcZlResourceManagerDefaultImpl.(BlbRcZlResourceManagerDefaultImpl.java:47)
at de.blb.rczl.onlinereports.ejb.BlbRcZlReportManager.onMessage(BlbRcZlReportManager.java:152)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
at java.lang.Thread.run(Thread.java:595)
Regards,
Sascha
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139437#4139437
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139437
18 years
[JBoss Cache: Core Edition] - Cache modified time not updated in a clustered environment.
by szkazmi
We are using jboss cache to save some key information in a session like object. Each object is stored under its own node and we have provided our own implementation of LRUInvalidationPolicy class which removes object from cache when evict is called (we are using 1.4.0SP1).
The cache region policy is set as given below
policyClass = "custom.LRUInvalidationPolicy"
maxNodes = 0
timeToLiveSeconds = 3600
maxAgeSeconds = 86400
In some cases we need to keep the session alive beyond the maximum timeToLiveSeconds. Hence we implemented a timer in client which retrieves the object from TreeCache with the expectation that LRU time stamp would be updated. Since we have the timeToLiveSeconds set to 60 minutes, we have this refresh timer running every 20 minutes to update the timestamp and keep the object in cache.
The problem is it that this does not work in clustered environment. In non-clustered environment, we can keep the object in cache as long as refresh timer is active. However in clustered environment the refresh timer has no impact and object is removed from cache in 60 minutes.
Form what I can tell the LRU timestamp is not replicated across the cluster. I have tested and verified this behavior in 1.4.1SP8 as well. What can we do to keep the session alive? Do we actually need to update the object itself to update its timestamp?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139427#4139427
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139427
18 years