Database Connection Timeout

I am using Openfire 3.5.2 and trying to run a query on the Openfire database(Using MySQL) which is supposed to take about 10 mins to execute. But my database connection gets automatically closed in ~5mins. Is there any known workaround for this problem, any property I can set?

WARN Log:


#0002 was active for 331153 milliseconds and has been removed automaticaly. The Thread responsible was named ‘client-10’, but the last SQL it performed is unknown because the trace property is not enabled.

ERROR Log:


2008.08.11 15:22:32 [my.database.DataTableValueDB.insert(DataTableValueDB.java:311)
]
java.sql.SQLException: Couldn’t perform the operation setAutoCommit: You can’t perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:8 7)
at $java.sql.Wrapper$$EnhancerByProxool$$68981aaa.setAutoCommit()
at my.database.DataTableValueDB.insert(DataTableValueDB.java:306)
at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents .process(InternalComponentManager.java:593)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:258)
at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:97)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:72)
at org.jivesoftware.openfire.net.StanzaHandler.processMessage(StanzaHandler.java:3 47)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processMessage(ClientStanzaHa ndler.java:91)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:208)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:175)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:133)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)
at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:185)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Unknown Source)

Any pointers??

Thanks !!

Hi,

there is a Proxool property named “maximumConnectionLifetime”, anyhow I have no idea how to access it form Openfire.

And it’s afaik a Proxool bug to print “… automaticaly. …” instead of “… automatically. …”

LG

Hi LG,

Thanks for the response.

After some research, I figured that Openfire is using Proxool for DB connection pooling. I think the property I need to set is “maximumActiveTime” but no idea how to configure it through Openfire. Does anybody know if this is exposed as a System property or if there are any plans to do so in future releases? We would definitely need to set this for some larger datasets we are trying to save on the server.

Thanks!!

I have messages of ~10MB which take 6 mins to be processed by the Openfire server and saved in the configured MySQL database. Does anybody know if this number is high or expected.

The Proxool DB Connection Manager used by Openfire has a proxool property “maximum-active-time” hard coded to 5 minutes. In order to get my use case to work, I added a configurable property in openfire.xml and modified org.jivesoftware.database.DefaultConnectionProvider to read the additional property. This change has enabled my request to be processed successfully. Does anybody know how I could put in a request for this to added as a feature request for the next release/contribute this myself.

Thanks !!