Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2010-02-04T14:56:51Z by JCanipe
JCanipe
JCanipe
88 Posts
ACCEPTED ANSWER

Pinned topic Scope of FQT during a MultiQuery operation

‏2009-12-08T19:14:54Z |
I am on IICE 8.4 FP4. I am currently developing a FQT to handle some specifics for my MultiQuery federated search. Can you tell me what is the scope -- life cycle -- for the FQT. Ex. Does it need to be threadsafe? Does the specific instance of the MultiQuery object use that thread, and no one else uses it? And does the FQT say persistent during the entire MultiQuery operation? Thus, can I store a value in my FQT class during the preProcessMultiQuery(...) and still have that value during postProcessResultSet(...)?
Thank you.
Updated on 2010-02-04T14:56:51Z at 2010-02-04T14:56:51Z by JCanipe
  • JCanipe
    JCanipe
    88 Posts
    ACCEPTED ANSWER

    Re: Scope of FQT during a MultiQuery operation

    ‏2009-12-11T15:42:41Z  in response to JCanipe
    After continued reading of the documentation within the sample FQT, I am going to make a big assumption (yes I know) that each MultiQuery operation gets a new copy of an FQT and it says persistent throughout the entire MultiQuery operation. Given that, if I need to store a variable at the class level (i.e. private String xyz = ...) and I need to reference that variable during other methods in the FQT, it will not have been updated by another concurrent MultiQuery operation (i.e. mine does not need to be threadsafe). If I am incorrect on this, please let me know.
    Thank you.
    • SystemAdmin
      SystemAdmin
      254 Posts
      ACCEPTED ANSWER

      Re: Scope of FQT during a MultiQuery operation

      ‏2009-12-11T23:02:34Z  in response to JCanipe
      Hi Jeff
      your assumption is correct. For each new MultiQuery, a new instance of the FQT is created. That FQT instance is used throughout the execution of the MultiQuery. However, the threads involved in one MultiQuery all share the same FQT instance. Hence, it is not safe to store repository-specific information in a FQT class-level variable. The methods preProcessQuery() and postProcessResults() must be programmed thread-safe.
      Daniela
  • JCanipe
    JCanipe
    88 Posts
    ACCEPTED ANSWER

    Re: Scope of FQT during a MultiQuery operation

    ‏2010-02-04T14:56:51Z  in response to JCanipe
    Thank you for the explanation of the scope of the FQT. Do you have any best practice advise (industry standards) on how to deploy/house the FQT. What I am referring to is: we run our Query process in WAS JVMs. Would it be a good idea to include the FQT within a package/class structure in our Query web app, thus the FQT class file is included in our Query application's .war file. Or would you recommend putting the FQT in it's own indep.jar file and letting it get loaded from this jar instead?