Configure the datasource idle-timeout-minutes property in EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
Issue
- How is the datasource property
idle-timeout-minutesconfigured? - I was not able to add/configure the
idle-timeout-minutesproperty. - By some load spike, ActiveCount increased. Then, after a while, ActiveCount doesn't decrease while InUseCount decreased. That means idle connections are not released from the connection pool. I want to release such connections from database resource perspective.
Resolution
Please set the idle-timeout-minutes attribute within the timeout element as follows :
...
<security>
...
</security>
<validation>
...
</validation>
<timeout>
<!-- specify a value appropriate for system constraints/desired behavior -->
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
...
References
- How does idle-timeout-minutes work in a datasource?
- Default idle-timeout-minutes setting
- See the Administration and Configuration Guide (table 6.10) for the definition of
idle-timeout-minutesand related timeout parameters - See also
idle-timeout-minutes(and related parameters) as defined in<JBOSS_HOME>/docs/schemajboss-as-datasources_1_0.xsdjboss-as-datasources_1_1.xsdjboss-as-datasources_1_2.xsdjboss-as-resource-adapters_1_0.xsdjboss-as-resource-adapters_1_1.xsd
- New datasources have idle-timeout-minutes set to 0 in EAP 6
Root Cause
- The
idle-timeout-minutesproperty hasn't been configured within thetimeoutelement in the datasource configuration.
Diagnostic Steps
- Please observe the following ERROR message in the server log :
ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at org.jboss.as.server.ServerService.boot(ServerService.java:324) [jboss-as-server-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:253) [jboss-as-controller-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: javax.xml.stream.XMLStreamException: org.jboss.as.connector.util.ParserException: IJ010061: Unexpected element: idle-timeout-minutes
at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:582)
at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:182)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final-redhat-2.jar:1.1.0.Final-redhat-2]
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.1.0.Final
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
