https://bz.apache.org/bugzilla/show_bug.cgi?id=64651

            Bug ID: 64651
           Summary: Issue with JDBC Post Processor while saving the
                    parameter value which contains special characters
                    which typically exists in JSON response
           Product: JMeter
           Version: 5.3
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: HTTP
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_5.3.1

Dear Sir,

I have the JSON from the prev response and trying to save it in the sql server
database after cleaning it a little bit but JDBC Post Processor is internally
seems to be splitting the response varchar string into many chunks as it may
contains commas, dots, angled brackets, double slashes etc. I know it because
for every JSON JDBC post processor is complaining that number of supplied
arguments are more than specified in the input to JDBC db saving request. For
every save request, the number of arguments are varying in the logs as
complained by the jdbc processor. However, if I take the same string and go to
sql server developer studio , I am able to save the string perfectly fine. So
sql server accepts it but problem is in the jdbc post processor how it
translates it to the jdbc driver, it seems that it is chopping the string into
multiple requests. 

so right now just to make it work, i had to use replace all on the json string
to replace all characters to the simple string using below logic..

String responseJSON2BSaved =
prev.getResponseDataAsString().replaceAll("[^a-zA-Z0-9=-></:.-]", "");
responseJSON2BSaved = responseJSON2BSaved.replaceAll(" ","");
responseJSON2BSaved = responseJSON2BSaved.replaceAll(":","");

//log.info("responseJSON2BSaved: " +responseJSON2BSaved);


vars.put("responseJSON2BSaved", responseJSON2BSaved);

This seems to be a bug in the jdbc processor. please advice, I would love to
make it work where I can save the JSON into the database as whole it is without
removing all its special characters.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to