On 03/03/2008, Abram Catalano <[EMAIL PROTECTED]> wrote:
> Sebb, has there been any news on this enhancement?  I'm not sure if you
>  filed a bug or not.

No, I did not file an enhancement request. I thought you were going to
do that...

>  It would be great to get this in, for me, so I don't have to package
>  jmeter and distribute our own version of JMeter internally.  I don't
>  have "complete" code (to submit a patch) - just as much as I needed to
>  get access to the actual resultSet data for select statements.  What can
>  I do to help?  I don't want to finish coding this up if my patch is just
>  going to be rejected anyways.  Whats the process here?
>

The process is:

==

Discuss change on user list (not always necessary; depends on change).

Create a Bugzilla enhancement with details of the proposed change.
If a patch is available, that can then be attached. Ideally the patch
will include test case(s) and documentation updates as needed.

Make sure that you have created the patch against the latest code in
trunk, and that it compiles and tests OK on the base version of Java
(currently 1.4 for JMeter).

If the patch is substantial, a CLA
(http://www.apache.org/licenses/#clas) may also be needed.

==

In this case, I'm still a bit wary of adding a new field to the
SampleResult class.

This is because of compatibility concerns (hopefully a full test would
show if that is a problem or not). Also, adding the field means a
reference will be kept, which can increase the memory requirements.
Not all JDBC test cases will need this, so I think the functionality
needs to be optional.

If we do add another SampleResult field, it needs to be an Object, so
we can re-use the field for other samplers if necessary.

Otherwise, to solve just this case, one could just store the data in a
variable; the JDBC Sampler screen could be extended to add an optional
variable name. i.e. if the name is specified, save the data reference
in the variable. This can easily be accessed from BeanShell etc. using
vars.getObject("VARNAME")

>
>  sebb wrote:
>  > On 07/01/2008, Abram Catalano <[EMAIL PROTECTED]> wrote:
>  >
>  >>  > This can get complicated, so it might be useful to extend the JDBC
>  >> sampler to make such checks easier.
>  >> Yeah, I'm not bad at regex, but I'd rather deal with columns, values and
>  >> newlines as structured data.
>  >>
>  >>  > Bugzilla can be used for enhancement requests too ... but it might be
>  >> best to discuss the proposal on JMeter user first. I'll start a thread
>  >> if no-one beats me to it.
>  >>
>  >>
>  >> What I've done locally here is add 1) "rawResponseData" to
>  >> SampleResult.java
>  >>
>  >
>  > This may perhaps affect JTL files.
>  >
>  >
>  >> 2) add res.setRawResponseData(data) in JDBCSampler.
>  >> Code below.  There are a bunch of cases I didn't catch with this  (when
>  >> _queryType != SELECT).
>  >>
>  >>  if (SELECT.equals(_queryType)) {
>  >>                stmt = conn.createStatement();
>  >>                ResultSet rs = null;
>  >>                try {
>  >>                    rs = stmt.executeQuery(getQuery());
>  >>                    Data data = getDataFromResultSet(rs);
>  >>                    res.setRawResponseData(data);
>  >>                    res.setResponseData(data.toString().getBytes());
>  >>                } finally {
>  >>                    close(rs);
>  >>                }
>  >>
>  >>
>  >> Then, I have the rawResponseData Data object available in BeanShell.
>  >>
>  >
>  > Which for some people may be as hard as using an RE     ;-)
>  >
>  >
>  >> Quick example:
>  >>
>  >>  (BeanShell code)
>  >>
>  >> import org.apache.jorphan.collections.*;
>  >> System.out.println("Headers");
>  >> header = SampleResult.getRawResponseData().getHeaders();
>  >> System.out.println("header length = "+header.length);
>  >>
>  >>
>  >>
>  >>
>  >>
>  >> ---------------------------------------------------------------------
>  >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>  >> For additional commands, e-mail: [EMAIL PROTECTED]
>  >>
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to