JDBC feeder alternatives; sharing values between scenarios

First, a little description of what I want to achieve and what I think I could do.

I run a simulation that executes three scenarios concurrently:

  1. The first one registers a user in my application, user data is saved to the database. It also saves a user identifier as a system property which could be then used by the other scenarios;
  2. The second scenario waits until the system property saved by the first scenario exists and then it queries the relevant user data from the database using the identifier. Then it starts some operation on the application;
  3. The third scenario does a similar thing, waits for the system property and queries the same user’s data to complete the same operation that was started by the second scenario.

So essentially, I want the second and third scenario to use the same user to deal with one operation. I want to get this case working first, but eventually I will have many pairs of the second and third scenarios, each pair will need its own user.

I first tried it with a feeder, but if I understand correctly the feeder is “evaluated” (maybe even populated? Not sure, I couldn’t get that far) in the beginning and therefore any further changes are not picked up. I mean when I wanted to use the values saved by the first scenario to find the user in the feeder, it didn’t work. I tried saving the system property to a session attribute, but it’s not possible to use the session in the feeder and EL of course displays “${value}”. The system property itself was null as it was not present before the first scenario populated it.

I have not tried it with just querying from the database yet, but it seems a bit more possible than with a feeder. However, I have only used DB queries to get one value at a time so far, how can I get a big bunch of values?

Another question: is there a better way for each scenario pair to receive one user instead of “transporting” the user identifier via system properties? If I will have, for example, 10 different test cases with 10 different users, I would need to save each user’s identifier to a separate system property (something numbered) after registration. Which maybe wouldn’t be that hard + the system properties will not show up anywhere anyway. But maybe there’s something else out there?

Any help would be greatly appreciated.

If it matters then I use Gatling version 2.2.2.

Ah, nevermind about getting multiple values from database query - resultSet.getString(columnLabel) should likely do the trick.

I implemented a solution on my own.

I hold the number of test cases (scenario pairs) in a variable.
I create a list of numbers (essentially test identifiers) from 1 to the number of test cases.
I feed that list to the registration scenario, so it registers the necessary number of users and each simulation user uses the number assigned to it to save the user identifier to a system property (e.g. userIdentifier1, userIdentifier2, etc).

I create a thread-safe (ConcurrentLinkedQueue) list of the test identifiers.
Each test case (scenario pair) has it’s own class which extends an abstract class. The abstract class contains the logic of asking for a unique number from the queue and composing the system property string using the number. This means each test class gets a unique test identifier and system property.
Both of the scenarios in the test then use that same system property string to get the user identifier from the system properties and then they both execute a DB query to get the same user data.