Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2386

Data Source Pool is not validating connections

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • master
    • master
    • JDBC, jpa
    • None

    Description

      I was seeing a couple exceptions in different calls: * Getting the list of emails via imap

      • Reading the emails via imap
      • Sending emails
      • Resolving the rewrite table
      • even in my personal mailet

       
      The only thing in common was the "cause" of the exception:

      Caused by: java.sql.SQLNonTransientConnectionException: (conn=17) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)

       
      I found that there must be an issue with the configuration of the BasicDataSource and I saw these properties are not set and cannot be set:
       

      basicDataSource.setTestOnBorrow(true);   
      basicDataSource.setValidationQuery("select 1"); // Is different by database. See list here: https://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases   
      basicDataSource.setValidationQueryTimeout(2);
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              simonl Simon Levesque
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: