cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC request is failing ramdomly

SOLVED
Highlighted
New Contributor

JDBC request is failing ramdomly

Hi All!

I hope you can help me. I created a test case with this test steps:

pgm33_1-1592436726619.png

I created a JDBC test step (check document status) with a query that checks that the document was created successfully in the database, but sometimes when I ran the test it fails, not always. I thought that if I execute the same query but in a Groovy script (check document status 2) it might work but the same thing is happening.

 

If I ran manually the step that fail it works. 

pgm33_2-1592437201913.png

What could be happening?  

 

Thanks in advance!

 

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: JDBC request is failing ramdomly

Hey @pgm33,

Ive had what appears to be the same issue on several different occasions and without knowing any more about your technical architecture im guessing its latency that is the problem (or at least that was the cause of when i had the same issues).
Essentially (on my system) my SQL was firing too soon after the REST request that created the record had completed and the RDBMS hadnt completed the record creation transaction under the covers.

I solved my issue by adding a Delay step in between the REST step and the JDBC step. The pause i added in was between 2 and 5 seconds depending on the technical architecture.
For example, if your REST endpoint is actually proxying the request (like via an ESB or API gateway which is occasionally called a "facade" step) before hitting the listening RDBMS webservice this was adding a little delay in the transaction. Ive even had this delay even when my endpoint wasnt a facade/proxy.

In summary: chuck in a delay of about 5 seconds and see if failure stops manifesting.

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Re: JDBC request is failing ramdomly

Hey @pgm33,

Ive had what appears to be the same issue on several different occasions and without knowing any more about your technical architecture im guessing its latency that is the problem (or at least that was the cause of when i had the same issues).
Essentially (on my system) my SQL was firing too soon after the REST request that created the record had completed and the RDBMS hadnt completed the record creation transaction under the covers.

I solved my issue by adding a Delay step in between the REST step and the JDBC step. The pause i added in was between 2 and 5 seconds depending on the technical architecture.
For example, if your REST endpoint is actually proxying the request (like via an ESB or API gateway which is occasionally called a "facade" step) before hitting the listening RDBMS webservice this was adding a little delay in the transaction. Ive even had this delay even when my endpoint wasnt a facade/proxy.

In summary: chuck in a delay of about 5 seconds and see if failure stops manifesting.

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
New Contributor

Re: JDBC request is failing ramdomly

@richie Thank you Richie! It works! 😀

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors