PostgreSQL
 sql >> Base de Dados >  >> RDS >> PostgreSQL

O pool de conexão do Jboss AS7 não será reconectado


Uma coisa a ser lembrada ao configurar o jboss é que às vezes a melhor documentação está nos projetos para os componentes individuais. No caso de configurações de fonte de dados, sempre digo às pessoas para verificar os documentos do IronJacamar:http://www.ironjacamar.org/doc/userguide/1.0/en-US/html_single/

para o que você quer fazer, estas configurações devem funcionar:
<validation>
    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>

    <!-- I don't know what this does but someone on my DevOps 
    team said to set it this way. :) -->
    <validate-on-match>false</validate-on-match>

    <!-- validate the connection using a background 
    thread rather than right before you try to use the connection -->
    <background-validation>true</background-validation>

    <!-- sets the frequency the background thread will check each connection.
    The lower this setting, the quicker it will find a bad connection 
    but it will be more chatty sending the validations to the server -->
    <background-validation-millis>60000</background-validation-millis>

    <!-- fast fail will mark all the connections invalid as soon as 
    it finds a bad one. This will make it clear the pool quicker 
    if all connections are reset at once such as a restart. Fast 
    fail would be trouble though if you had a setup where the database
    sometimes selectively kills a single connection, such as killing long
    running queries. -->
    <use-fast-fail>true</use-fast-fail>

</validation>