Sections include:
Understanding the SQL Responder Action Tool
The SQL Responder Action tool enables you to establish an interconnected virtualization environment where an operation made by a Message Responder updates values in a virtual database that is represented by a CSV-driven SQL Responder.
For instance, assume that you are working with a banking service that handles account transfers, deposits, and withdrawals. These operations change the values stored in a database. Now assume that you virtualized the service with a Message Responder and virtualized the database with a SQL Responder. How do you ensure that any new transactions performed from your virtual service update the values that were previously recorded for your virtual database?
By applying SQL Responder Action tools, you can create a synchronized environment so that when the virtualized service performs an operation, it will update the corresponding value in the virtual database. That updated virtual database value can then be accessed or operated on by yet another virtual asset (perhaps another service that retrieves account values and transaction histories), creating a chain of interconnected operations.
Configuring the SQL Responder Action Tool
To add a SQL Responder Action tool, chain it as an outgoing response to the Message Responder that modifies data in the virtual database.
Next, configure the options on the Target, ResultSet Selector and Row Selector tabs.
Target Tab
Configure the following settings in this tab:
- Target column: Specifies the virtual database column you want to modify.
- Operation: Describes how you want to modify the existing data in the virtual database.
- Value: Specifies the value that will be used to perform the specified operation. You can use specific fixed values. For instance, if you’re transferring $100 from one account to another, the value here would be 100. You can also use scripted or parameterized values, for example, a value that was pulled from the incoming request and stored in an Incoming Request > XML Data Bank tool.
- JDBC URL: Points Virtualize to the appropriate set of files captured during the database recording. Type
j.
to open a list of valid JDBC URLs.
ResultSet Selector Tab
Add Query Parameters table values to specify which recorded result set you want updated with the value and operation specified in the Target tab. For instance, you might have result sets for customer_id 12212 and customer_id 12222. If you want this action to be performed only on queries for customer_id 12212, you would indicate this as follows:
Note that the names and values that you specify here need to correspond to the actual values in the SQL query and result set (see the SQL Responder control panel to review the actual values).
Row Selector Tab
Specify which rows of the SQL query result set you want to operate on.
A single SQL query result set could include multiple rows. Using this control, you can specify if the operation should be performed on all rows or on specific rows. For instance, if the result set includes multiple accounts for customer_id 12212 and you want to operate only on account ID 12345, you would indicate this as follows:
The names and values that you specify here need to correspond to the actual row values (see the .csv file referenced in the SQL Responder control panel to review the actual values).
Resetting Data Modified by the Tool
To reset the originally recorded values for any data that was modified by this tool:
- In the Virtualize Server view, double-click Local machine.
- In the page that opens, click Reset.