Forum Discussion

pgm33's avatar
pgm33
New Contributor
5 years ago

JDBC request is failing ramdomly

Hi All! I hope you can help me. I created a test case with this test steps: I created a JDBC test step (check document status) with a query that checks that the document was created successfu...
  • richie's avatar
    5 years ago
    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