me0wster / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Support MS SQL statistics Detail #267

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. go to SQL statistics
2. click detail view
3. click one of SQLs Link

What is the expected output? What do you see instead?
I expect to see the performance of this SQL execution but get the following 
error instead:
"Execution Plan java.lllegalArgumnetException:Database type unknown:<DB URL>"

What version of the product are you using? On what application server, JDK,
operating system?
JDK: 1.6.0_31
Application Server: tomcat 7.027
OS: Win 7
DB: MSSQL sqljdbc4

Please provide any additional information below.

In the source code of net.bull.javamelody.JdbcDriver.java, there is no MSSQL 
support.

Bruce
Thanks

Original issue reported on code.google.com by Bruce.Bu...@gmail.com on 26 Nov 2012 at 4:53

GoogleCodeExporter commented 9 years ago
Just want correct that the source code is 
net.bull.javamelody.DatabaseInformations.java not jdbcDriver.java.
thanks,
Bruce

Original comment by Bruce.Bu...@gmail.com on 26 Nov 2012 at 5:09

GoogleCodeExporter commented 9 years ago
It is absolutely possible that this code does not know anything about MSSQL yet.

To fix that, can you confirm that in the exception "Database type unknown:<DB 
URL>", <DB URL> contains the word "mssql" in lower case ?

And can you give at least one sql request giving information or performance 
information on the mssql database?
For example, do you confirm that "select current_timestamp" or perhaps "select 
current_timestamp()" will give a result from mssql?

Original comment by evernat@free.fr on 26 Nov 2012 at 5:30

GoogleCodeExporter commented 9 years ago
Thank you very much for your quick response.
I can not find the "mssql" in lower case on the exception as the following:

"Execution plan java.lang.IllegalArgumentException: Database type unknown: 
jdbc:sqlserver://...;databaseName=ABC;applicationName=Microsoft SQL Server JDBC 
Driver; "

I also see that the database name is not the proper DB for this application 
use. (I have deployed more than 5 applications under one tomcat instance and 
one DB name per application.) The DB name shown on exception is not the one for 
that application.

Most of my SQL is DB procedure call like "{? = call usp_get*(?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?)}". 
However, I do have one simple SQL request like:
"select column_nmae ... From table".
However, when I click this simple SQL detail by the link, I get the same 
exception error.

Thanks again for your help.
Bruce

Original comment by Bruce.Bu...@gmail.com on 26 Nov 2012 at 7:10

GoogleCodeExporter commented 9 years ago
More information from the execution of the MSSQL:

select @@version
-- Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 
19:23:43   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on 
Windows NT 6.1 <X64> (Build 7601: Service Pack 1) 
select GETDATE() -- 2012-11-26 14:19:38.543
select @@CONNECTIONS -- select @@CONNECTIONS

Bruce
select @@CPU_BUSY -- 768916

Original comment by Bruce.Bu...@gmail.com on 26 Nov 2012 at 7:23

GoogleCodeExporter commented 9 years ago
This is now fixed.
The error "Execution plan java.lang.IllegalArgumentException: Database type 
unknown: jdbc:sqlserver..." will not be displayed anymore in the SQL details.

And two basic reports on MS SQLSERVER will also be displayed in "System 
information / Database".

It is committed in trunk (revision 3161) and ready for the next release (1.42).
I have made a new build from the current trunk and it is available at:
http://javamelody.googlecode.com/files/javamelody-20121127.jar

Thanks

Original comment by evernat@free.fr on 27 Nov 2012 at 10:09

GoogleCodeExporter commented 9 years ago
Yes. The new jar (javamelody-20121127.jar) works very well.
It's amazing to see it get fixed withing 24 hours.
Thank you very much.
Bruce

Original comment by Bruce.Bu...@gmail.com on 28 Nov 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Yes it is amazing, because
You give all the information.
I code based on that, without available resources to test.
You test and it works.
That's it, then release.

Original comment by evernat@free.fr on 28 Nov 2012 at 9:04

GoogleCodeExporter commented 9 years ago
Thanks.
I have one question related the SQL statistics detail: (not sure if anybody 
else asked it before):
Is it possible to monitor the sql parameter values (shown as '?' currently) 
passed into DB from application?
Thanks again for your time.
Bruce

Original comment by Bruce.Bu...@gmail.com on 29 Nov 2012 at 9:31

GoogleCodeExporter commented 9 years ago
No, it is currently not possible to monitor the sql parameter values. Sorry.

Original comment by evernat@free.fr on 29 Nov 2012 at 10:36