Anything Better Than P6Spy

Anything better than P6Spy?

We still use P6Spy with our Weblogic 8.1.5 with EJB2.0 and it works charms. I'm about to try and integrate it with Weblogic 10.3 and EJB3.0

Understanding HikariCP/JDBC driver classnames vs data source classnames

In one case the connection is created through java.sql.DriverManager (or maybe even directly using the java.sql.Driver implementation), and you can only use the configuration properties the driver supports that way.

When using a data source, you're using an implementation of javax.sql.DataSource, and can only use the configuration properties the data source supports that way. If we're talking about driver-provided DataSource implementations, there generally is no difference. They usually offer the same (or similar) configuration properties, and produce exactly the same connection as they would return through their Driver implementation.

In theory, using a DataSource can have some benefits because of its programmatic configuration (instead of using properties in the URL or Properties object), and the fact you could have the DataSource sourced from some external configuration through JNDI or other means.

However, when configured through HikariCP, and specifically in the way as shown in your question, there is no substantial difference.

hibernate p6spy problem

Ah - I see the problem, which appears to be due to what I have to say is a rather surprising design decision in p6spy.

Apparently for batched statements, the decision was made to log statements as they are added to the batch, and then show the LAST statement executed when the batch is actually executed! Once you know that's what the tool does, I guess you can understand why it's there, but it's completely confusing and counter-intuitive unless you happen to have read the thread here:

http://sourceforge.net/projects/p6spy/forums/forum/166969/topic/666877

SQL logging in Websphere 6.1

It does depend on the way that you are accessing the database. If you are using Hibernate then you can make that spit out its SQL, if you are accessing the datasource through WAS then you can use the trace service. Set the trace to something like:

=info: com.ibm.websphere.rsadapter.=detail

And see what you get out of it.



Related Topics



Leave a reply



Submit