You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/03/03 12:51:18 UTC

DO NOT REPLY [Bug 50860] New: In case of invalid or empty slqQuery connection are always invalidated without usefull information

https://issues.apache.org/bugzilla/show_bug.cgi?id=50860

           Summary: In case of invalid or empty slqQuery connection are
                    always invalidated without usefull information
           Product: Tomcat Modules
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: olamy@apache.org


The code is (in PooledConnection.java#validate(int validateAction,String sql) )
        Statement stmt = null;
        try {
            stmt = connection.createStatement();
            stmt.execute(query);
            stmt.close();
            this.lastValidated = now;
            return true;
        } catch (Exception ignore) {
            if (log.isDebugEnabled())
                log.debug("Unable to validate object:",ignore);
            if (stmt!=null)
                try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
        }
        return false;

So in the case of null or invalid query (connection is always invalidated :
seems normal :-) ).
But without any usefull message (except if you use debug : but seems
complicated in a production env).
So IMHO adding a log.warning in case of null query could be usefull.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50860] In case of invalid or empty slqQuery connection are always invalidated without usefull information

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50860

--- Comment #1 from Alexander Pogrebnyak <al...@reflexion.net> 2011-10-19 16:57:10 UTC ---
Although it seems similar to Bug 50660, the case of a `null` query is really a
misconfiguration error.

I think it should be treated differently from "invalid" SQL case and in case of
`null` query throw RuntimeException that tells the user about misconfiguration.

I also think that obvious configuration validation (validationQuery is null or
empty, when validation is enabled ) has to happen when the connection is
initialized (or better yet in ConnectionPool.init), because in my test it would
not happen before the validationInterval would have expired, and a one-off
message in the middle of log stream does not call to much attention.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50860] In case of invalid or empty slqQuery connection are always invalidated without usefull information

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50860

Filip Hanik <fh...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Filip Hanik <fh...@apache.org> 2012-03-20 17:33:53 UTC ---

> I also think that obvious configuration validation (validationQuery is null or
> empty, when validation is enabled ) has to happen when the connection is

that would be a separate issue, feel free to open bugzilla issue


This has been fixed in by adding a configuration option called
logValidationErrors="true|false" in r1303031

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50860] In case of invalid or empty slqQuery connection are always invalidated without usefull information

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50860

Alexander Pogrebnyak <al...@reflexion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex-pub.apache-ant@reflexi
                   |                            |on.net

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org