Re: org.apache.tomcat.jdbc.pool casting to original connection class

2018-08-24 Thread Torsten Krah
The isWrapperFor(..) and unwrap(..) methods on the connection API should
work for this.


org.apache.tomcat.jdbc.pool casting to original connection class

2018-08-24 Thread Alex O'Ree
I have a use case where i need to downcast a pooled database connection
down to the native class that is in use for the driver. Unfortunately I
don't see any APIs that I can use to do this. Is there any backdoors or
mechanisms I can use?

Background, I'm using postgres with tomcat 8.5 and need to access some
postgres specific apis, (the large binary object api). I've tried with both
the tomcat based pool and the dbp2 connection pooling too.


Re: Tomcat Valve

2018-08-24 Thread Mark Thomas
On 24/08/18 17:36, Campbell, Lance wrote:
> I don't understand.  How does that help a valve running know that it is 
> shutting down?  At that point it would be too late.

The point is you don't need a valve to answer your question. Just look
at the last 9 entries in the access log.

Mark

> 
> On 8/24/18, 11:06 AM, "Mark Thomas"  wrote:
> 
> On 24/08/18 16:52, Campbell, Lance wrote:
> > Tomcat 9
> > Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
> application.  Then if Tomcat shuts down I want to write out these last N 
> number of URLs to the log file.
> > 
> > Strategy:
> > I figured I would use a valve to keep track of the last N number of 
> URLs.  However I don’t know how to tell when the valve is shutting down.
> > 
> > Does anyone have any suggestions?
> 
> tail -n 9 ${CATALINA_BASE}/logs/localhost_access_log.-mm-dd.txt
> 
> Mark
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve

2018-08-24 Thread Campbell, Lance
I don't understand.  How does that help a valve running know that it is 
shutting down?  At that point it would be too late.  

On 8/24/18, 11:06 AM, "Mark Thomas"  wrote:

On 24/08/18 16:52, Campbell, Lance wrote:
> Tomcat 9
> Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
application.  Then if Tomcat shuts down I want to write out these last N number 
of URLs to the log file.
> 
> Strategy:
> I figured I would use a valve to keep track of the last N number of URLs. 
 However I don’t know how to tell when the valve is shutting down.
> 
> Does anyone have any suggestions?

tail -n 9 ${CATALINA_BASE}/logs/localhost_access_log.-mm-dd.txt

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve

2018-08-24 Thread Mark Thomas
On 24/08/18 16:52, Campbell, Lance wrote:
> Tomcat 9
> Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
> application.  Then if Tomcat shuts down I want to write out these last N 
> number of URLs to the log file.
> 
> Strategy:
> I figured I would use a valve to keep track of the last N number of URLs.  
> However I don’t know how to tell when the valve is shutting down.
> 
> Does anyone have any suggestions?

tail -n 9 ${CATALINA_BASE}/logs/localhost_access_log.-mm-dd.txt

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat Valve

2018-08-24 Thread Campbell, Lance
Tomcat 9
Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
application.  Then if Tomcat shuts down I want to write out these last N number 
of URLs to the log file.

Strategy:
I figured I would use a valve to keep track of the last N number of URLs.  
However I don’t know how to tell when the valve is shutting down.

Does anyone have any suggestions?

Thanks,

Lance


[OT] What can prevent sessions from timeouting apart from real requests

2018-08-24 Thread Leon Rosenberg
Hi,

one of the systems we are consulting has encountered a strange problem. The
sessions will build up indefinitely but never expire. Then, at one point
(at 02am in the night, 19K sessions would drop at once).
Of course the simplest explanation would be that someone is actively
requests something every 15 minutes (session timeout) keeping track of the
JSESSIONID. We are trying to track this through the access_log and such.
However, my question, is it possible to prevent session from timeouting by
doing something stupid code-wise? Like storing a session in a hashmap
somewhere, and accessing some attributes from time to time? My
understanding was that the session timeout is solely dependent on incoming
requests and handled by the container, but I was not 100% sure ;-)

Thanks in advance
Leon


RE: Contexts: can there be a hierarchy?

2018-08-24 Thread Jäkel , Guido
Dear Chuck,

>It's a hierarchy for the URLs, but not from a webapp location, construction,
>or execution perspective - /foo/bar is completely independent of /foo, not
>inside or a subset of it.

Reading that I understand what you have pointed out and of course fully agree 
to it :)

Greetings

Guido

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org