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 2002/07/01 02:39:37 UTC

DO NOT REPLY [Bug 10361] - JDBCRealm requires restart if JDBC connection fails.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10361>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10361

JDBCRealm requires restart if JDBC connection fails.





------- Additional Comments From rthomas-contrib@liveintellect.org  2002-07-01 00:39 -------
I did a bit of additional testing on this and found that the problem I was 
seeing was reporting a "Communications link failure: java.io.IOException" but 
must have actually been wrapped and thrown in an SQLException.  The 
modification to recurse and try at least twice would still be helpful to avoid 
the login failure for the first arrival to a failed JDBC connection.  The 
private signature of authenticate that has the firstTry boolean argument still 
applies, but the suggested modification to the catch would acutally be 
something like the following:

   } catch (SQLException e) {
      if (firstTry && dbConnection != null) { 
        close(dbConnection);  // close the connection
        return authenticate(username, password, false); // try a 2nd time
     }
     else {   // give up and hope something changes before next login
        // bla bla bla, etc. etc.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>