commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Presley <anth...@zoraptera.com>
Subject Re: DBCP "Statement already closed .... how?"
Date Tue, 25 Nov 2003 22:59:19 GMT
Thank you Dirk ..... where do you live?  I owe you a Pizza.

This did, in fact, solve almost all of my problems.  Subtle [to me].

However, I have a remaining issue, and I've narrowed it down to the
following lines of code.  I'll post in the tomcat user group, but
thought someone here might have a pearl of wisdom.

Nine times out of ten, multiple requests work perfectly.  However, in
the one time out of ten that it doesn't, my code is throwing an
Exception with this:

      try {
        if (rd != null)
          rd.forward(req, res);
        else {
          log("RD is NULL, MAJOR ERROR");
        }
      } catch (ServletException e) {
        log("5ERROR ServletException: " + e.getMessage());
        e.printStackTrace();
      } catch (java.io.IOException e) {
        log("5ERROR java.io.IOException: " + e.getMessage());
        e.printStackTrace();
      } catch (Exception e) {
        log("5ERROR Exception: " + e.getMessage());
        e.printStackTrace();
      }

Doing a reload on it, it works fine.  IE, what is being sent (the URL)
does start with a "/", and rd is NOT null (neither are req or res).

The Error is: 
	5ERROR Exception: Cannot forward after response has been commit

Googling is again, less than helpful (although it appeared that in
Version 3.3 this error was common, I'm now on 4.1).

On Tue, 2003-11-25 at 15:15, Dirk Verbeeck wrote:
> The problem with the example code you posted is then "conn" variable.
> It should be declared inside the method (local variable) and not as a member 
> variable.
> 
> Your example works if only one request is processed.
> A second request overwrites the connection of the first one.
> So the first connection is lost and at the end, both requests will try to 
> close the same connection two times triggering the exception you see.
> 
> -- Dirk


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message