-
I am using the
Any suggestions on how to go about modifying hammerdb to accomplish this? I am rusty on tcl!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There is already the ability to re-run the entire script using the Virtual User Iterations option: This can then be used to reconnect after a failure. An example is shown here using SQL Server, however the approach can be used for any database. Firstly make sure that RAISEERROR is set to true so that errors caused the driver script to exit. Then at the start of the script, if needed, add a catch to close any connections from the previous iteration, in this case we have added obdc close to the start of the script. Note that also in a scenario where the system may be down for a period of time you may want to add a pause before trying to connect by also adding a line such as the following which will sleep for 60 seconds before trying to reconnect.
Now run the workload as normal, in this example I have used the following SQL to query the session ids and then called kill to kill a particular session.
If you look at Virtual User 3 you can see that we killed the session 3 times, and it shows Iterations complete 3 times and then reconnected (because it it is re-running the script in its entirety) Following this methodology for any database will allow you to test scenarios where a connection is dropped and you want to reconnect. Being all scripted gives you this flexibility to change test scenarios as you need. |
Beta Was this translation helpful? Give feedback.
There is already the ability to re-run the entire script using the Virtual User Iterations option:
This can then be used to reconnect after a failure. An example is shown here using SQL Server, however the approach can be used for any database.
Firstly make sure that RAISEERROR is set to true so that errors caused the driver script to exit.
Then at the start of the script, if needed, add a catch to close any connections from the previous iteration, in this case we have added obdc close to the start of the script.
Note that also in a scenario where the system may be down for a period of time you may want to add a pause before trying to connect by also adding a line such as the following…