You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Daleiden, Mike" <MD...@national.aaa.com> on 2012/11/29 21:29:57 UTC

Odd behavior of JDBC Sampler

I have a JMeter test plan that is used to execute a test of a JSON-based web service. Part of the validation for this test requires that the underlying MySQL database is checked for the existence of a record containing a data element unique to the request. The unique data element content is being generated by JMeter using the ${__time()} function. The test successfully executes the JSON service, but for some reason the JDBC sampler that follows immediately after the HTTP sampler (for the JSON request) does not return the data correctly. The query is very straightforward:

SELECT correlationId
FROM testdb.audit_log
WHERE service = 'jsonService'
ORDER BY create_timestamp DESC LIMIT 5

When this query is executed by the sampler, it returns the following:

    correlationId
    20121129150230526
    20121129142656490
    20121129141800995
    20121129141703545
    20121129141548601

However, the same query executed against the test database (which is not being used by any other processes or users) immediately after the JMeter test completes returns the following:

    20121129150411820
    20121129150230526
    20121129142656490
    20121129141800995
    20121129141703545

Note that the first record returned by the direct database query is NOT in the resultset return from the EXACT SAME QUERY executed by the JDBC Sampler. I have executed this test multiple times to ensure that this behavior consistently occurs. Each and every test run exhibits this same OFF BY ONE issue with the JDBC Sampler result.

Any thoughts on why this might be occurring would be greatly appreciated.

--Mike Daleiden




  ________________________________
This communication (including all attachments) is intended solely for
the use of the person(s) to whom it is addressed and should be treated
as a confidential AAA communication. If you are not the intended
recipient, any use, distribution, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately delete it from your system and notify the originator. Your
cooperation is appreciated.

Re: Odd behavior of JDBC Sampler

Posted by chaitanya bhatt <bh...@gmail.com>.
:)

Thanks
Chaitanya

On Thu, Nov 29, 2012 at 1:52 PM, Daleiden, Mike
<MD...@national.aaa.com>wrote:

> Odd. I added back in the delay between the samplers and it now works as
> expected.
>
> --Mike
>
>
> -----Original Message-----
> From: Philippe Mouawad [mailto:philippe.mouawad@gmail.com]
> Sent: Thursday, November 29, 2012 4:46 PM
> To: JMeter Users List
> Subject: Re: Odd behavior of JDBC Sampler
>
> Hello,
> What is the config of your JDBC Sampler regarding transactional attribute ?
> and other attributes
> Regards
> Philippe
>
> On Thu, Nov 29, 2012 at 10:31 PM, Daleiden, Mike <
> MDaleiden@national.aaa.com
> > wrote:
>
> > I did that with no effect. I even played with a delay of up to 10
> seconds.
> > The thing is that once the HTTP sampler returns, the audit record has
> > already been written to the database, as that is done as part of the
> > JSON service itself.
> >
> > --Mike
> >
> >
> > -----Original Message-----
> > From: chaitanya bhatt [mailto:bhatt.chaitanya@gmail.com]
> > Sent: Thursday, November 29, 2012 4:29 PM
> > To: JMeter Users List
> > Subject: Re: Odd behavior of JDBC Sampler
> >
> > Try introducing a small delay between the HTTP sampler and JDBC sampler.
> >
> > Thanks
> > Chaitanya
> >
> > On Thu, Nov 29, 2012 at 12:29 PM, Daleiden, Mike <
> > MDaleiden@national.aaa.com
> > > wrote:
> >
> > > I have a JMeter test plan that is used to execute a test of a
> > > JSON-based web service. Part of the validation for this test
> > > requires that the underlying MySQL database is checked for the
> > > existence of a record containing a data element unique to the
> > > request. The unique data element content is being generated by
> > > JMeter using the ${__time()} function. The test successfully
> > > executes the JSON service, but for some reason the JDBC sampler that
> > > follows immediately after the HTTP sampler (for the JSON
> > > request) does not return the data correctly. The query is very
> > > straightforward:
> > >
> > > SELECT correlationId
> > > FROM testdb.audit_log
> > > WHERE service = 'jsonService'
> > > ORDER BY create_timestamp DESC LIMIT 5
> > >
> > > When this query is executed by the sampler, it returns the following:
> > >
> > >     correlationId
> > >     20121129150230526
> > >     20121129142656490
> > >     20121129141800995
> > >     20121129141703545
> > >     20121129141548601
> > >
> > > However, the same query executed against the test database (which is
> > > not being used by any other processes or users) immediately after
> > > the JMeter test completes returns the following:
> > >
> > >     20121129150411820
> > >     20121129150230526
> > >     20121129142656490
> > >     20121129141800995
> > >     20121129141703545
> > >
> > > Note that the first record returned by the direct database query is
> > > NOT in the resultset return from the EXACT SAME QUERY executed by
> > > the JDBC Sampler. I have executed this test multiple times to ensure
> > > that this behavior consistently occurs. Each and every test run
> > > exhibits this same OFF BY ONE issue with the JDBC Sampler result.
> > >
> > > Any thoughts on why this might be occurring would be greatly
> appreciated.
> > >
> > > --Mike Daleiden
> > >
> > >
> > >
> > >
> > >   ________________________________
> > > This communication (including all attachments) is intended solely
> > > for the use of the person(s) to whom it is addressed and should be
> > > treated as a confidential AAA communication. If you are not the
> > > intended recipient, any use, distribution, printing, or copying of
> > > this email is strictly prohibited. If you received this email in
> > > error, please immediately delete it from your system and notify the
> > > originator. Your cooperation is appreciated.
> > >
> >
> > This communication (including all attachments) is intended solely for
> > the use of the person(s) to whom it is addressed and should be treated
> > as a confidential AAA communication.  If you are not the intended
> > recipient, any use, distribution, printing, or copying of this email
> > is strictly prohibited.  If you received this email in error, please
> > immediately delete it from your system and notify the originator.
> > Your cooperation is appreciated.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>
> This communication (including all attachments) is intended solely for
> the use of the person(s) to whom it is addressed and should be treated
> as a confidential AAA communication.  If you are not the intended
> recipient, any use, distribution, printing, or copying of this email is
> strictly prohibited.  If you received this email in error, please
> immediately delete it from your system and notify the originator.  Your
> cooperation is appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: Odd behavior of JDBC Sampler

Posted by "Daleiden, Mike" <MD...@national.aaa.com>.
Odd. I added back in the delay between the samplers and it now works as expected.

--Mike


-----Original Message-----
From: Philippe Mouawad [mailto:philippe.mouawad@gmail.com]
Sent: Thursday, November 29, 2012 4:46 PM
To: JMeter Users List
Subject: Re: Odd behavior of JDBC Sampler

Hello,
What is the config of your JDBC Sampler regarding transactional attribute ?
and other attributes
Regards
Philippe

On Thu, Nov 29, 2012 at 10:31 PM, Daleiden, Mike <MDaleiden@national.aaa.com
> wrote:

> I did that with no effect. I even played with a delay of up to 10 seconds.
> The thing is that once the HTTP sampler returns, the audit record has
> already been written to the database, as that is done as part of the
> JSON service itself.
>
> --Mike
>
>
> -----Original Message-----
> From: chaitanya bhatt [mailto:bhatt.chaitanya@gmail.com]
> Sent: Thursday, November 29, 2012 4:29 PM
> To: JMeter Users List
> Subject: Re: Odd behavior of JDBC Sampler
>
> Try introducing a small delay between the HTTP sampler and JDBC sampler.
>
> Thanks
> Chaitanya
>
> On Thu, Nov 29, 2012 at 12:29 PM, Daleiden, Mike <
> MDaleiden@national.aaa.com
> > wrote:
>
> > I have a JMeter test plan that is used to execute a test of a
> > JSON-based web service. Part of the validation for this test
> > requires that the underlying MySQL database is checked for the
> > existence of a record containing a data element unique to the
> > request. The unique data element content is being generated by
> > JMeter using the ${__time()} function. The test successfully
> > executes the JSON service, but for some reason the JDBC sampler that
> > follows immediately after the HTTP sampler (for the JSON
> > request) does not return the data correctly. The query is very
> > straightforward:
> >
> > SELECT correlationId
> > FROM testdb.audit_log
> > WHERE service = 'jsonService'
> > ORDER BY create_timestamp DESC LIMIT 5
> >
> > When this query is executed by the sampler, it returns the following:
> >
> >     correlationId
> >     20121129150230526
> >     20121129142656490
> >     20121129141800995
> >     20121129141703545
> >     20121129141548601
> >
> > However, the same query executed against the test database (which is
> > not being used by any other processes or users) immediately after
> > the JMeter test completes returns the following:
> >
> >     20121129150411820
> >     20121129150230526
> >     20121129142656490
> >     20121129141800995
> >     20121129141703545
> >
> > Note that the first record returned by the direct database query is
> > NOT in the resultset return from the EXACT SAME QUERY executed by
> > the JDBC Sampler. I have executed this test multiple times to ensure
> > that this behavior consistently occurs. Each and every test run
> > exhibits this same OFF BY ONE issue with the JDBC Sampler result.
> >
> > Any thoughts on why this might be occurring would be greatly appreciated.
> >
> > --Mike Daleiden
> >
> >
> >
> >
> >   ________________________________
> > This communication (including all attachments) is intended solely
> > for the use of the person(s) to whom it is addressed and should be
> > treated as a confidential AAA communication. If you are not the
> > intended recipient, any use, distribution, printing, or copying of
> > this email is strictly prohibited. If you received this email in
> > error, please immediately delete it from your system and notify the
> > originator. Your cooperation is appreciated.
> >
>
> This communication (including all attachments) is intended solely for
> the use of the person(s) to whom it is addressed and should be treated
> as a confidential AAA communication.  If you are not the intended
> recipient, any use, distribution, printing, or copying of this email
> is strictly prohibited.  If you received this email in error, please
> immediately delete it from your system and notify the originator.
> Your cooperation is appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


--
Cordialement.
Philippe Mouawad.

This communication (including all attachments) is intended solely for
the use of the person(s) to whom it is addressed and should be treated
as a confidential AAA communication.  If you are not the intended
recipient, any use, distribution, printing, or copying of this email is
strictly prohibited.  If you received this email in error, please
immediately delete it from your system and notify the originator.  Your
cooperation is appreciated.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Odd behavior of JDBC Sampler

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
What is the config of your JDBC Sampler regarding transactional attribute ?
and other attributes
Regards
Philippe

On Thu, Nov 29, 2012 at 10:31 PM, Daleiden, Mike <MDaleiden@national.aaa.com
> wrote:

> I did that with no effect. I even played with a delay of up to 10 seconds.
> The thing is that once the HTTP sampler returns, the audit record has
> already been written to the database, as that is done as part of the JSON
> service itself.
>
> --Mike
>
>
> -----Original Message-----
> From: chaitanya bhatt [mailto:bhatt.chaitanya@gmail.com]
> Sent: Thursday, November 29, 2012 4:29 PM
> To: JMeter Users List
> Subject: Re: Odd behavior of JDBC Sampler
>
> Try introducing a small delay between the HTTP sampler and JDBC sampler.
>
> Thanks
> Chaitanya
>
> On Thu, Nov 29, 2012 at 12:29 PM, Daleiden, Mike <
> MDaleiden@national.aaa.com
> > wrote:
>
> > I have a JMeter test plan that is used to execute a test of a
> > JSON-based web service. Part of the validation for this test requires
> > that the underlying MySQL database is checked for the existence of a
> > record containing a data element unique to the request. The unique
> > data element content is being generated by JMeter using the
> > ${__time()} function. The test successfully executes the JSON service,
> > but for some reason the JDBC sampler that follows immediately after
> > the HTTP sampler (for the JSON
> > request) does not return the data correctly. The query is very
> > straightforward:
> >
> > SELECT correlationId
> > FROM testdb.audit_log
> > WHERE service = 'jsonService'
> > ORDER BY create_timestamp DESC LIMIT 5
> >
> > When this query is executed by the sampler, it returns the following:
> >
> >     correlationId
> >     20121129150230526
> >     20121129142656490
> >     20121129141800995
> >     20121129141703545
> >     20121129141548601
> >
> > However, the same query executed against the test database (which is
> > not being used by any other processes or users) immediately after the
> > JMeter test completes returns the following:
> >
> >     20121129150411820
> >     20121129150230526
> >     20121129142656490
> >     20121129141800995
> >     20121129141703545
> >
> > Note that the first record returned by the direct database query is
> > NOT in the resultset return from the EXACT SAME QUERY executed by the
> > JDBC Sampler. I have executed this test multiple times to ensure that
> > this behavior consistently occurs. Each and every test run exhibits
> > this same OFF BY ONE issue with the JDBC Sampler result.
> >
> > Any thoughts on why this might be occurring would be greatly appreciated.
> >
> > --Mike Daleiden
> >
> >
> >
> >
> >   ________________________________
> > This communication (including all attachments) is intended solely for
> > the use of the person(s) to whom it is addressed and should be treated
> > as a confidential AAA communication. If you are not the intended
> > recipient, any use, distribution, printing, or copying of this email
> > is strictly prohibited. If you received this email in error, please
> > immediately delete it from your system and notify the originator. Your
> > cooperation is appreciated.
> >
>
> This communication (including all attachments) is intended solely for
> the use of the person(s) to whom it is addressed and should be treated
> as a confidential AAA communication.  If you are not the intended
> recipient, any use, distribution, printing, or copying of this email is
> strictly prohibited.  If you received this email in error, please
> immediately delete it from your system and notify the originator.  Your
> cooperation is appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


-- 
Cordialement.
Philippe Mouawad.

RE: Odd behavior of JDBC Sampler

Posted by "Daleiden, Mike" <MD...@national.aaa.com>.
I did that with no effect. I even played with a delay of up to 10 seconds. The thing is that once the HTTP sampler returns, the audit record has already been written to the database, as that is done as part of the JSON service itself.

--Mike


-----Original Message-----
From: chaitanya bhatt [mailto:bhatt.chaitanya@gmail.com]
Sent: Thursday, November 29, 2012 4:29 PM
To: JMeter Users List
Subject: Re: Odd behavior of JDBC Sampler

Try introducing a small delay between the HTTP sampler and JDBC sampler.

Thanks
Chaitanya

On Thu, Nov 29, 2012 at 12:29 PM, Daleiden, Mike <MDaleiden@national.aaa.com
> wrote:

> I have a JMeter test plan that is used to execute a test of a
> JSON-based web service. Part of the validation for this test requires
> that the underlying MySQL database is checked for the existence of a
> record containing a data element unique to the request. The unique
> data element content is being generated by JMeter using the
> ${__time()} function. The test successfully executes the JSON service,
> but for some reason the JDBC sampler that follows immediately after
> the HTTP sampler (for the JSON
> request) does not return the data correctly. The query is very
> straightforward:
>
> SELECT correlationId
> FROM testdb.audit_log
> WHERE service = 'jsonService'
> ORDER BY create_timestamp DESC LIMIT 5
>
> When this query is executed by the sampler, it returns the following:
>
>     correlationId
>     20121129150230526
>     20121129142656490
>     20121129141800995
>     20121129141703545
>     20121129141548601
>
> However, the same query executed against the test database (which is
> not being used by any other processes or users) immediately after the
> JMeter test completes returns the following:
>
>     20121129150411820
>     20121129150230526
>     20121129142656490
>     20121129141800995
>     20121129141703545
>
> Note that the first record returned by the direct database query is
> NOT in the resultset return from the EXACT SAME QUERY executed by the
> JDBC Sampler. I have executed this test multiple times to ensure that
> this behavior consistently occurs. Each and every test run exhibits
> this same OFF BY ONE issue with the JDBC Sampler result.
>
> Any thoughts on why this might be occurring would be greatly appreciated.
>
> --Mike Daleiden
>
>
>
>
>   ________________________________
> This communication (including all attachments) is intended solely for
> the use of the person(s) to whom it is addressed and should be treated
> as a confidential AAA communication. If you are not the intended
> recipient, any use, distribution, printing, or copying of this email
> is strictly prohibited. If you received this email in error, please
> immediately delete it from your system and notify the originator. Your
> cooperation is appreciated.
>

This communication (including all attachments) is intended solely for
the use of the person(s) to whom it is addressed and should be treated
as a confidential AAA communication.  If you are not the intended
recipient, any use, distribution, printing, or copying of this email is
strictly prohibited.  If you received this email in error, please
immediately delete it from your system and notify the originator.  Your
cooperation is appreciated.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Odd behavior of JDBC Sampler

Posted by chaitanya bhatt <bh...@gmail.com>.
Try introducing a small delay between the HTTP sampler and JDBC sampler.

Thanks
Chaitanya

On Thu, Nov 29, 2012 at 12:29 PM, Daleiden, Mike <MDaleiden@national.aaa.com
> wrote:

> I have a JMeter test plan that is used to execute a test of a JSON-based
> web service. Part of the validation for this test requires that the
> underlying MySQL database is checked for the existence of a record
> containing a data element unique to the request. The unique data element
> content is being generated by JMeter using the ${__time()} function. The
> test successfully executes the JSON service, but for some reason the JDBC
> sampler that follows immediately after the HTTP sampler (for the JSON
> request) does not return the data correctly. The query is very
> straightforward:
>
> SELECT correlationId
> FROM testdb.audit_log
> WHERE service = 'jsonService'
> ORDER BY create_timestamp DESC LIMIT 5
>
> When this query is executed by the sampler, it returns the following:
>
>     correlationId
>     20121129150230526
>     20121129142656490
>     20121129141800995
>     20121129141703545
>     20121129141548601
>
> However, the same query executed against the test database (which is not
> being used by any other processes or users) immediately after the JMeter
> test completes returns the following:
>
>     20121129150411820
>     20121129150230526
>     20121129142656490
>     20121129141800995
>     20121129141703545
>
> Note that the first record returned by the direct database query is NOT in
> the resultset return from the EXACT SAME QUERY executed by the JDBC
> Sampler. I have executed this test multiple times to ensure that this
> behavior consistently occurs. Each and every test run exhibits this same
> OFF BY ONE issue with the JDBC Sampler result.
>
> Any thoughts on why this might be occurring would be greatly appreciated.
>
> --Mike Daleiden
>
>
>
>
>   ________________________________
> This communication (including all attachments) is intended solely for
> the use of the person(s) to whom it is addressed and should be treated
> as a confidential AAA communication. If you are not the intended
> recipient, any use, distribution, printing, or copying of this email is
> strictly prohibited. If you received this email in error, please
> immediately delete it from your system and notify the originator. Your
> cooperation is appreciated.
>