humungs
humungs

Reputation: 1194

JBoss / WildFly connection pooling and closed connections

I have some applications running on JBoss 4.2.2, JBoss 5.1 and WildFly 8.1.0. All these applications use connection pooling. My datasources are something like that:

<datasource jta="false" jndi-name="java:/datasource/myawesomeds" pool-name="MyAwesomeDS" enabled="true" use-ccm="false">
    <connection-url>jdbc:oracle:thin:@myserver.example.com:1521:oracle_service</connection-url>
    <driver-class>oracle.jdbc.OracleDriver</driver-class>
    <driver>ojdbc6.jar</driver>
    <security>
        <user-name>username</user-name>
        <password>MyPassWord</password>
    </security>
    <validation>
        <validate-on-match>false</validate-on-match>
        <background-validation>false</background-validation>
    </validation>
    <statement>
        <share-prepared-statements>false</share-prepared-statements>
    </statement>
</datasource>

As you can see, I use Oracle Database. The server version is 10g. When Oracle DB going down for a few minutes all my applications on JBoss and WildFly start showing SQLException: Closed Connection.

My question: Is it normal? Why JBoss and WildFly don't check the connections to verify this?

Upvotes: 1

Views: 9468

Answers (1)

Kurt Du Bois
Kurt Du Bois

Reputation: 7665

Yes, this is normal.

You can however define that wildfly/jboss should verify the connection when fetching it from the connection pool. All your connections will be invalid, so normally it should create a new connection for you if you defined a minimum number of connections that should be present.

Upvotes: 1

Related Questions