Re: logging outgoing requests from Tomcat to SQL

2009-01-29 Thread Gergely Paljak
Hi Christopher,

thanks for the comment, it's really interesting!

And it looks like more wrapping than before christmas, but I have never
taken a close look on JDBC implementations (at least not this close).

So, i'd be interested in that *super-sexy *class wrapper generator of yours!
Also in any experience, pitfalls or sources for manuals if you might have
some ideas!

Thank you,
Gergely Paljak

2009/1/28 Christopher Schultz ch...@christopherschultz.net:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Gergely,

 Gergely Paljak wrote:
 A want to realize a logging system for tomcat that is capable of:
 - logging the incoming request for Servlets (easy)
 - and logging the time when the Tomcat response is sent (easy as well)

 As you say, these are relatively easy to accomplish.

 - logging the outgoing SQL queries inside Tomcat while maintaining a
mapping
 between the requested Servlet and the sent SQL queries
 - logging the incoming SQL query results

 I think your best bet is to implement your own DataSource that extends
 Tomcat's built-in datasource (or some other one, if you like). Have your
 DataSource return Connection objects that wrap the ones provided by
 Tomcat's DataSource object.

 Your Connection class should produce wrapped Statement classes that log
 the statements as they are executed, and wrapped ResultSet objects that
 do ... something else. Due to the specific JDBC spec requirements about
 how results are read, you may have to settle for only reading those
 values /actually read/ by the application, instead of the entire result
set.

 I have implemented JDBC interface wrappers before, and they are
 completely miserable to do (just sooo much plumbing code). I wrote a
 super-sexy class wrapper generator if you're interested in doing
 something like this.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkmAplsACgkQ9CaO5/Lv0PAySgCfZSTz2qkBq4yZD3HCuvAYDTBb
 2ygAnR3SMz+fR0Ow1rBF+lJcfjm5YJEU
 =wTg7
 -END PGP SIGNATURE-

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




logging outgoing requests from Tomcat to SQL

2009-01-28 Thread Gergely Paljak
Hi,

I have encountered the following challenge regarding which I would like to
ask you!

A want to realize a logging system for tomcat that is capable of:
- logging the incoming request for Servlets (easy)
- logging the outgoing SQL queries inside Tomcat while maintaining a mapping
between the requested Servlet and the sent SQL queries
- logging the incoming SQL query results
- and logging the time when the Tomcat response is sent (easy as well)

I would like to ask for you advice on how to log the SQL part? How to match
the SQL queries with Servlets without modifying the Servlet code? Could it
be realized by a valve? I have taken a look at the valves, but I haven't
found anything useful.

All comments are welcome!

Thank you,
Gergely Paljak


cluster - v5.5 or v6.x or v?

2008-08-22 Thread Gergely Paljak
Hi all,

I would like to ask for your advice on a clustering issue. I intend to run a
Tomcat cluster with a very old and simple application *, so the supported
Servlet/JSP specs don't matter to me at all. What essential is that I want
to adjust my cluster dynamically - i.e. add and remove nodes without the
clients taking notice of the change. Session replication, failover, robust,
reliable implementations are for me.

I did read both the v5.5 and v6 manual on this issue (and other docs), and I
know that the cluster support is completely rewritten in the new version.
Still, I'm unsure which version to use.

Any kind of advice would be most welcome!

Thanks in advance,
Gergely Paljak

*A TPC-W implementation, this one: http://mitglied.lycos.de/jankiefer/tpcw/