On 5 December 2014 at 21:59, Yngvi Þór Sigurjónsson <[email protected]> wrote:
> Hi
> I'm new to JMeter, what I want to do is to do load testing on some Oracle
> database applications. Using the JDBC Sampler I have run into a little snag
> with the way variables are stored as strings after the JDBC request to 
> Callable
> Statement.
>
> In Oracle it is a common practice to return queries from stored procedures
> as a construct called refcursor. Refcursors are then returned as ResultSets
> to Java and if you really want to do thorough load test you actually have
> to loop through the whole result set.  This would be simple to do with a
> JSR223 sampler following the JDBC sampler if it was not for the fact that
> the JDBC sampler stores the ResultSet object as a string.
>
> Fixing this is actually a single line edit of the file
> AbstractJDBCTestElement.java line 256 to:
> jmvars.putObject(name, o);
> instead of:
>  jmvars.put(name, o == null ? null : o.toString());
>
> Does anyone know if there is a good reason for this toString, or if It
> could be fixed in the official source?

JMeter variables can store arbitrary objects, but mostly JMeter
assumes that variables contain Strings.
There's no in-built way to use variables unless they are Strings, but
as you noted they can be accessed in user code, for example in a
JSR-223 or BeanShell test element.

It would break existing test plans if JDBC were changed as you suggest.

There are ways round this:
- provide a way to select Object storage for all variables. However
this would be a nuisance if the variable is not a RefCursor
- provide a way to select Object storage specific variable names
- provide a way to select Object storage for specific variable types
(e.g. all RefCursor types)

It's vital that any such change is optional, and does not change the
existing behaviour.

> I'm ready to provide any further information and a working sample if
> requested.

> Regards
> Yngvi

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to