Delay Transaction on Roxie

29 Views Asked by At

Scenario: a client wants to test a scenario where they run a transaction against a Roxie service, and they would like the transaction to take at least 50 seconds before it returns anything. What is a good approach to this?

One idea I had is to maybe use the current time and add 50 seconds to it, and when the current time = current time + 50 seconds, we would let the query continue/resume. Maybe use WHEN(), WAIT(), or something else? Any insights would be appreciated.

2

There are 2 best solutions below

1
Richard Taylor On

First, I'd like to state that this goes against the very design concept of ROXIE, which has always been about making queries as fast as possible -- usually sub-second response to any/every query. I cannot imagine a real-world scenario where this kind of long-delayed response would be desirable.

With that said, you certainly could experiment with using either the WHEN workflow service or the WAIT function to accomplish this. I can't immediately think of any other way you might do this in Roxie. I'd be interested to hear about the results of your experimentation.

Personally, I would probably just insert the return response delay into whatever GUI frontend you're providing to the query. IOW, I would not "mess around" with Roxie and just delay displaying the returned data to the end-user for however long you choose.

HTH,

Richard

0
flyer On

Thanks for the feedback. I agree with you on making queries as fast as possible on Roxie. However, to clarify, this was a request from a customer where they wanted to test a bad scenario while doing some integration testing.

I did experiment with the WHEN workflow service and the WAIT function, but they didn't appear to work as I anticipated on Roxie. I then did some more research and learned that using Sleep() works like a charm.

Thanks!