Bug 38682 - JDBC Sampler does not support prepareCall
JDBC Sampler does not support prepareCall
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.1.1
Other other
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-02-16 18:35 UTC by Richard Gaywood
Modified: 2007-04-14 14:19 UTC (History)
0 users



Attachments
JDBCSampler Patch for handling Calling Procedures (2.77 KB, patch)
2006-03-26 12:36 UTC, Ronald Bradford
Details | Diff
JDBCSamplerBeanInfo Patch for Calling Procedures (576 bytes, patch)
2006-03-26 12:37 UTC, Ronald Bradford
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gaywood 2006-02-16 18:35:15 UTC
The JDBC Sampler can only carry out stmt.executeQuery() on the query defined in
the configuration. If this is run against MS SQL Server (and possibly other
RDBMSs), it will cause the server have to parse the incoming stored procedure
call each time and prohibit it from caching the compiled stored procedure. This
is bad for performance and can give falsely low readings.

JDBCSampler.java should be adjusted to use conn.prepareCall(...) instead, which
correctly invokes stored procedures through an RPC call to the database server.
This will require some changes to the GUI however.
Comment 1 Ronald Bradford 2006-03-26 12:36:12 UTC
Created attachment 17982 [details]
JDBCSampler Patch for handling Calling Procedures
Comment 2 Ronald Bradford 2006-03-26 12:37:10 UTC
Created attachment 17983 [details]
JDBCSamplerBeanInfo Patch for Calling Procedures
Comment 3 Sebb 2006-03-26 12:55:32 UTC
Thanks, I'm taking a look
Comment 4 Sebb 2006-03-26 17:05:29 UTC
Duh! I was confusing prepareCall() with prepareStatement().

I've checked the code into the 2.1 branch, and it is in the nightly build:
2-1.20060326

Please advise if it is working OK
Comment 5 Rub 2006-10-27 02:59:24 UTC
Works ok. But not all JDBC drivers will invoke an RCP call to the server if the
CallableStatement has no real parameters. Those are not currently supported see
 Bug 40825 (http://issues.apache.org/bugzilla/show_bug.cgi?id=40825) for more
details.