Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Shared Map across pva's

vkumar
vkumar Posts: 29

I have a requirement to share the data between two pva's.

  • The first pva responder will generate response. I have to keep/share the data generated in the response
  • The second pva responder has to access the data generated by the first pva for its response

If i m using File I/O facing caching problem. If i would like to keep the data in memory at run time is there any option/recommendation ?

Thanks,
Vinoth.

Comments

  • vkumar
    vkumar Posts: 29

    One more point to add :
    Currently i m writing the necessary information to a file using an scripted extention in the first pva
    I m again using a script to read the same file in the second pva.

    When the threads/no of calls increases , i might faces I/O errors.

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭

    What do you keep in file, right now? Do you have just a single response?
    What will happen if first pva generate a second response?
    How second pva will distinguish correct data?

  • vkumar
    vkumar Posts: 29
    • The first pva response will have random parameters generated in the response.
      Some values from request and values generated in the response should be saved for the second pva.

    • The second pva will get the request from the client application. Based on the input request parameters i have to do a look up on those values from first pva and respond back accordingly(Pl. note in this response - the values we should use from first pva request and response parameters

  • Ramiro Martinez
    Ramiro Martinez Posts: 53 admin

    Hi Vkumar,

    If your two responders are in the same PVA then you can use Test suite variables which are cached during run time and will persistent from one response to the next.

    The scenario would be the first request comes in and hits the first responder due to specific request correlation.
    Chain a data bank tool to the first responder and extract whatever information you need for your second request and save these values into the test variables.

    When the second request hits the PVA, then the correlation from your first responder should make this request incompatible with the first responder therefore it will hit the second responder.

    This responder will parameterize the values from the test suite values, which should have the values that were previously saved from the last request.

    The test suite variables will reset after re-deployments and restarting the Virtualize server.

    Please note this scenario, will only keep one set of data from previous calls.

    If this does not fit your scenario, then you may wanna try using the "write file" tool to keep a hard copy of the data and then call on that file with a messaging client(transport-less)/data bank tool.

    Best regards,

    Ramiro

  • vkumar
    vkumar Posts: 29

    Hi Ramiro , Thank you. This will not solve my purpose. I understand you have explained here to virtualize stateful calls. We have done that for few cases. But here my need is different.
    I m writing to a file from first pva and reading it in thorugh second pva. The data will be refereshed in the first pva and the second pva has to dynamically cache it. As you know the auto refresh feature in eclipse not working seamlessly i m trying to keep it in shared memory(instead of a file) which can be used by both the pva's

  • [Deleted User]
    [Deleted User] Posts: 0 admin

    It sounds like another option would be to use the CRUD tool and write the data to a data repository and then have the 2nd PVA read it from the data repository.

  • vkumar
    vkumar Posts: 29

    Hi John ,

    You are referrring DB tool option or SQL Responder action for saving the data from first pva ?

    Thanks,
    Vinoth.

  • [Deleted User]
    [Deleted User] Posts: 0 admin

    On the Marketplace there is a CRUD tool, (create, read, update, delete) for the data repository. I'm thinking that you could write your data from pva1, into a data repository and then pva2 could read it.

  • [Deleted User]
    [Deleted User] Posts: 0 admin

    I'm thinking pva_x1 could write, pva_x2 could read and if you need multiple occurrences available at the same time pva_y1 & pva_y2 you do the same and so on. Since the data repository is dynamic there shouldn't be any refresh issues.

  • vkumar
    vkumar Posts: 29

    Thank you John

  • [Deleted User]
    [Deleted User] Posts: 0 admin
    edited February 2017

    Hi Vinoth, just for my own interest, what release of virtualize are you using? With the CRUD tool, there is an example. If it doesn't work for you, you may need a more recent data repository. Let us know and we will figure out how to get it to you if needed. Also, when you set up your data source, there is a option to cache or not. If you are using the CRUD tool, you need the data to be dynamic and will not want the data repository to be cached. It might have been obvious, however if you have the data repository cached, the data won't be dynamic. Just thought I'd mention it.

  • vkumar
    vkumar Posts: 29

    Hi John,

    I m using Virtualize 9.9. Thank you so much for all your inputs and help. I have just seen the tool in the marketplace. I will try it out and let you know.

    Thanks,
    Vinoth.