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/02/11 01:12:24 UTC

DO NOT REPLY [Bug 50759] New: ValidatorClassName Validation fails to set lastValidated timestamp

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

           Summary: ValidatorClassName Validation fails to set
                    lastValidated timestamp
           Product: Tomcat Modules
           Version: unspecified
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: dominic.tootell@gmail.com


When using a custom validator (48817), after the first validation event occurs,
every subsequent query on the connection results in the Validator being run.  I
believe this is due to the lastValidated timestamp not being set when the
Validator class is run:

http://svn.apache.org/viewvc/tomcat/tags/JDBC_POOL_1_0_9_3/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?revision=1061025&view=markup
 (lines 419-420)

public boolean validate(int validateAction,String sql) {

   ...
   if (poolProperties.getValidator() != null) {
            return poolProperties.getValidator().validate(connection,
validateAction);
   }
   ....
}


maybe should be:

public boolean validate(int validateAction,String sql) {

   ...
   if (poolProperties.getValidator() != null) {
            boolean val = poolProperties.getValidator().validate(connection,
validateAction);
            this.lastValidated = now;
            return val;
   }
   ....
}


/dom

-- 
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 50759] ValidatorClassName Validation fails to set lastValidated timestamp

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

Chuck Caldarale <ch...@unisys.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Chuck Caldarale <ch...@unisys.com> 2011-02-10 21:22:34 EST ---
Might want to set lastValidated only when the validate() method returns true:

    if (val) lastValidated = now;

-- 
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 50759] ValidatorClassName Validation fails to set lastValidated timestamp

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

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

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

--- Comment #2 from Filip Hanik <fh...@apache.org> 2011-02-11 11:32:55 EST ---
Thanks for the report.
Fixed in r1069864

-- 
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