The purpose of programmatic view called several times ExecuteQueryForCollection

[JDev/ADF v11.1.1.5.0]

I am trying to create a VO that is not supported by DB, but instead takes its data from an external source (subsequently, a web service, but that's irrelevant to this question). I followed on each sample, I found and have created the VO and all overridden methods. I use this VO to create a LOV list for a VO another attribute, and the values in the LOV will vary based on a value in another attribute in the main volume (this is called LOVs cascading in various places).

Here's an example, using the HR schema (a little artificial, I admit it):

-Two your - DepartmentVO and ManagerVO - are defined

-The DepartmentVO is supported by the DB and a normal EO and VO.

-L' Manager in the DepartmentVO attribute is set to a supported by the ManagerVO LOV

-The ManagerVO is programmatic and returns a list of employees who are in the same Department as the DepartmentID in the line of master DepartmentVO. To do this, use a Bind Variable (DeptId) that is set up to take the value of the DepartmentID attribute in the current line of DepartmentVO. This value of binding is used to filter the list of employees referred to only in the same Department.

-J' replaced the executeQueryForCollection method in ManagerVOImpl. Here, I retrieve the value of the variable DeptId bind parameters passed in object/object2 to the method, and then use to retrieve employees in this Department of my main source.

So far so good. Presents all works. (He lifts the employees in the same Department and displays them in the popup LOV.) If you change the Department then click to display the attribute Manager LOV, it shows you the list of employees in the new Department.)

The problem I see is that the executeQueryForCollection method is called several times (2 or 3), causing the recovery of employees in the Department occur several times. For example, the test by running the AM executeQueryForCollection is called when I click the button to display the popup LOV (which makes sense). However, it is said AGAIN when I click the OK button in the popup LOV after selecting one of the values. (This should NOT!) And, if I create a JSF page and drop the data control to create a form and test it in this way, the executeQueryForCollection is called THREE times!

I have the logic in the class ManagerVOImpl, which checks whether the list of employees has been recovered already, and if so, it's just returns the existing list. However, multiple calls are actually coming from different instances of the VO class, so that they only "see" the list has already been retrieved (because she was retrieved from another instance of the class, not this one).

So my question is: How can I ADF do not call the executeQueryForCollection several times during the use of the VO as a LOV so that my (very expensive) call in the master repository to retrieve the list of employees is not executed more than necessary?  Is my only option to implement share caching mechanism myself that stores the list of employees of a Department somewhere in memory? I thought that ADF BC will make caching for me at the level VO?

Thanks for any help that anyone can provide. I have literally been taken with that for two weeks, when I thought it would be a 'fast' to implement! :-)

I'd be happy to upload/attach the source of my 'ManagerVOImpl' class, if that would be helpful.

Have you tried to put a conditional statement in your back-end call happens only on your principal of the VO and not on the other 2 forums and see if that affects your functionality?

that is, if (myIdName == "myVOInstance") {}

do things;

}

I did it with VO this call that some heavy DB stored procedures in the executeQueryForCollection.

Tags: Java

Similar Questions

  • method of before the Phase of initMethod() in view calling several times:

    Hello world

    I dragged a table as read-only table with simple rank of verified selection.
    A button to go there in the page.
    The code in the go button takes the curretn by selecting the current row and the values of print.
    The initMethod() code is execution of the VO.

    The problem is when the page load the initMethod() (before the phase in view) calls several times even after loading the page.
    Continuously its call to this method.

    How to call only once when the page is loaded?

    All suggestions will be really useful.

    Thank you.

    Hello Kumar,
    There are many topics on the web to achieve this.
    This is one of them
    https://blogs.Oracle.com/ADF/entry/an_epic_question_how_to

  • Function used in the view definition is called several times

    I'm writing a view that boils down to the following statement:

    SELECT val, val)
    SELECT SYS_GUID() val
    OF the double
    )

    Against my expectation, which calls SYS_GUID() twice, resulting in two different values for val.

    I have written here as view inline, but it must be a regular view in reality. Is it possible to build this view while SYS_GUID is called only once, even if the resulting value is then selected several times? Naively, I want to affect the outcome of SYS_GUID to a variable, and then select the value of this variable. However, this seems not possible in a view.

    New to Oracle PL/SQL. This works as expected in T - SQL SQL Server.

    Thanks for any help or insight you can provide.

    -Brian

    Hmmm, I have no 11 + available so I can't check a solution, but I would like to test:

    SELECT val, val FROM (
    SELECT SYS_GUID() val
    FROM dual
    WHERE ROWNUM = 1
    )
    

    or

    SELECT val, val FROM (
    SELECT /*+ NO_MERGE */ SYS_GUID() val
    FROM dual
    )
    

    Edit: the no_merge indicator seems to work in 10.2.0.4

    Published by: David_Aldridge on December 14, 2010 23:21

  • Type of the object called several times Oracle constructor

    I have an object of type with a custom constructor. In SQL, when I reference attributes the constructor is called several times in Oracle 11.2.0.4.

    1. Why the constructor is called more than once?
    2. How can I stop it?

    My current job is about to reference attributes and use the / * + materialize * / tip.


    Problem installation

        create or replace type Foo as object
        (
          Bar1 NUMBER,
          Bar2 NUMBER,
          Bar3 NUMBER,
    
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
        )
    /
        create or replace type body Foo is
    
          -- Member procedures and functions
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
          AS
          BEGIN
            SELF.Bar1 := p_Bar1;
            SELF.Bar2 := p_Bar2;
            SELF.Bar3 := p_Bar3;
            dbms_output.put_line('Foo Constructor Called');
            RETURN;
          END;
    
        end;
    

    Problem

        -- Constructor is called 6 times! 
        -- Once for each column and once for each predicate in the where clause.
        SELECT x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3, f
        FROM (
          SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
          FROM dual d
        ) x
        WHERE x.f.bar1 = x.f.bar1 AND x.f.bar2 = x.f.bar2
    

    Output

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Foo constructor called

    Workaround

        -- Work Around
        -- Constructor is called 3 times
        -- Once for each column in the inline view. 
        -- Note, I removed column f (the object type) because it's not compatible with the materialize hint.
        WITH y AS (
          SELECT /*+ materialize */ x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3
          FROM (
            SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
            FROM dual d
          ) x
        )
        SELECT y.bar1, y.bar2, y.bar3
        FROM y
        WHERE y.bar1 = y.bar1 AND y.bar2 = y.bar2
    

    Another solution is described in this thread... Access to the fields of an object custom type... which makes use of a type of collection combined with SCOREBOARD operator, like this...

    create or replace type FooTable as table of Foo;
    
    SELECT x.bar1 AS bar1, x.bar2 AS bar2, x.bar3 AS bar3, value(x) f
        FROM table(FooTable(
          foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3)
        )) x
        WHERE x.bar1 = x.bar1 AND x.bar2 = x.bar2
    ;
    
    BAR1 BAR2 BAR2 F
    1    2    3    (1, 2, 3)
    
    Foo Constructor Called
    

    Hope that helps...

    Gerard

  • FieldChangeListener fieldChanged called several times to EditField?

    Why fieldChanged is called several times in an EditField and how to avoid what is happening or maybe even control how many times the method, I want to be called, is called.

    The debugger that I noticed that my method is running serval times, most of the time + 20 times, and it's ruining the flow of just this is an edit field, is far from avoid this? I'm doing something wrong? or is this a normal behavior?

    I'm past the code if it helps, but if I can get the answers to these questions, am sure I can fix the code myself.

    Thank you

    Nevermind, figured it out, sorry for losing space, bandwidth, etc etc.

  • Windows 7 64 bit worked very well and when was time to save I get the cyclic redundancy check, I try several times and made the same thing I need help please

    worked very well and when was time to save I get the cyclic redundancy check, I try several times and made the same thing I need help please

    Hello Hans,.

    Thanks for choosing Microsoft Community!

    According to the description of the problem, you have problems when you use the backup on Windows 8 feature.

    Please answer these questions to better understand the issue and help you:

    1. are - what you're talking to backup and restore functionality on Windows 7?

    2 have you made any changes to the computer before the show?

    It is perhaps to cause bad sectors on the hard drive, run the disk check to repair bad sectors

    Check your hard drive for errors:

    http://Windows.Microsoft.com/en-us/Windows7/check-your-hard-disk-for-errors

    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

    For more information:

    Backup and restore: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/back-up-and-restore-frequently-asked-questions

    Hope the helps of information. Don't answer if you need assistance, we will be happy to help you.

  • I filled out a form on the page 8 and he saved several times along the way, and now when I open this file, the form is empty?  How can I save my work so I can open the form later and it contains all my data?

    I filled out a form on the page 8 and he saved several times along the way, and now when I open this file, the form is empty?  How can I save my work so I can open the form later and it contains all my data?

    Hi Eileen97933052,

    The PDF form must be extended drive in order to have this feature to save & print the form data.

    Please confirm by the PDF Creator is the PDF reader or not extended.

    Otherwise, if you have Acrobat installed on your system, you can reader extend PDF form yourself.

    Kind regards

    Nicos

  • Update could not get the following error U44M1I210.  Tried several times on 2 Mac running Yosemite

    Try to update CC 2015 without success.  Update could not get the following error U44M1I210.  Tried several times on 2 Mac running Yosemite.  Any ideas?

    U44... Update error http://forums.adobe.com/thread/1289956 can help

    -U44 more... discussion http://forums.adobe.com/thread/1275963

    -http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-updates-ccm.html

    -http://helpx.adobe.com/creative-suite/kb/error-u44m1i210-installing-updates-ccm.html

  • Cloud to adobe InDesign download fails with shoing error it can not extract the files in the temporary file.  I tried several times and restarted does not.  What can I do about it?

    Cloud to adobe InDesign download fails with shoing error it can not extract the files in the temporary file.  I tried several times and restarted does not.  What can I do about it?

    To refer to EX11 some:

    Creative cloud (WIP) error codes | Error postal codes of Mylenium

    Mylenium

  • The error message "no more virtual tiles can be allocated" appears when I try to use the effects in the quick edit mode in my 13 elements. The OK wand has to press several times for loading all effects models. The error returns when selecting th

    The error message "no more virtual tiles can be allocated" appears when I try to use the effects in the quick edit mode in my 13 elements. The OK wand has to press several times for loading all effects models. The error returns when you select the particular model.

    The problem does not appear, if PH 13 items is run in administrator mode.

    The available computer resources are rather big enough: INTEL CPU i7 4 cores, 16 GB RAM, 1 TB HDD + 32 GB SSD, Windows 8.1.

    Please, advice how to fix this problem? Perhaps, there is patch or update available?

    I had this problem with some of the choices menu in PSE13 when my drive to work was only a SSD with 53 GB of free space. I assigned a second disc of work (my data disc with ~ 2 TB of free space) and the error disappeared.

    Scratch disk settings can be found under preferences / Performance.

  • (Bug)  Function that is called on the authenticationSuccess parameter is called several times

    < rtc:AdobeHSAuthenticator id = "auth" authenticationKey = '{authToken}' protocol = "rtmfp" authenticationSuccess = "onAuthSuccess (); "authenticationFailure ="onAuthFailure (event); "/ >

    The onAuthSuccess() function that is called at all times

    Hi Ashish,

    Can you give us the smallest possible complete app that reproduces it

    question? I just built a simple and it worked.

    Thank you

    Nigel

  • The binding of the method to the &lt; af:table value = "" was run several times "

    I have create a new jsf page in a Web of Fusion project.

    Defined a table as follows:
    < af:table value = "#{pageFlowScope.taskListBean.tasks}" var = 'row' "
    rowBandingInterval = "0" id = "t2" width = "689".
    rowSelection = "single" summary = "show the task list.
    partialTriggers =": cmi1: cmi2: cmi3: cmi4: soc2: soc1" > "
    < af:column sortable = "false" headerText = 'Number' align = 'end' id = "c1" rowHeader = "true" >
    < af:outputText value = "#{row.number}" id = "ot5" / > "
    < / af:column >
    < af:column sortable = "false" headerText = "Id" align = "DΘmarrer" id = 'c3' >
    < af:outputText value = "#{row.id}" id = "ot2" / > "
    < / af:column >
    < af:column sortable = "false" headerText = "Title" align = "DΘmarrer" id = "c2" >
    < af:outputText value = "#{row.title}" id = "ot4" / > "
    < / af:column >
    < af:column sortable = "false" headerText = "State" align = "DΘmarrer" id = "c5" >
    < af:outputText value = "#{row.state}" id = "ot3" / > "
    < / af:column >
    < af:column sortable = "false" headerText = 'Result' align = 'start '.
    ID = 'c4' >
    < af:outputText value = "#{row.outcome}" id = "ot1" / > "
    < / af:column >
    < af:column sortable = "false" headerText = "PrioritΘ" align = 'end' id = 'c6' >
    < af:outputText value = "#{row.priority}" id = "ot6" / > "
    < / af:column >
    < / af:table >

    When I look in the log, I found that the method getTasks() in the taskListBean has been performed several times? There is a performance problem. Can someone tell me why? How to fix?

    http://StackOverflow.com/questions/2090033/why-JSF-calls-getters-multiple-times

  • My organization wants to partner with Mozilla, I filled out the form of "Work with us" several times but no feedback

    I filled out this form https://www.mozilla.org/en-US/about/partnerships/ several times and I never receive any comments. Is there a phone number I can use to get in touch with Mozilla on a potential partnership or email?

    Hi Kombuta,

    Thanks for your post, I'm sorry that you don't have a response to the form that you filled for the partnership with us. Can you tell me when you have completed the form, by chance? This will help me to direct the proper person to your form.

    Otherwise, you can also send me a private message to [email protected] with the information and I will pass along (I'm a Mozilla employee, customer management).

    Thank you and my apologies for the late reply, I appreciate your patience and your interest in Firefox OS!

    Kind regards
    Michelle Luna

  • my computer screen goes off for a few seconds and the lights without turning off the unit. This has happened several times, regardless of the period in which stays on.

    My computer operating system Mac Pro OS X EL Capitan 10.10.3, ink 13"early 2015 screen off for a few seconds and back on without turning off the unit.

    This has happened several times, regardless of the period in which stays on.

    Don't know what is happening with your publication details.  You posted in space of the Macbook Pro forum & even your profile indicates: ' MacBook Pro (retina, 13-inch, early 2015), OS X Yosemite (10.10.3)..

    Your post indicates you are using a Mac Pro, which is a desktop computer and with the help of El Capitan who is 10.11.2 not 10.10.3 which is Yosemite - 'my computer operating system Mac Pro OS X EL Capitan 10.10.3.

  • Live2011 Windows Messenger. cannot get at any stage of the operation can not even log in I have deleted the program and down he loaded several times

    Windows live messenger, message get the application could not start due to its configeration side by side is incorrect. see the application log. This means nothing to me. I have uninstalled and reinstalled several times?

    The issue is part of Windows Live Solution Center.
    Thanks for posting to the category of Messenger: http://windowslivehelp.com/forums.aspx?productid=2 for the benefit of other people looking for answers, please mark as answer suggestion if it solves your problem.

Maybe you are looking for

  • Only has Skippidity (sp?) where and how did get there?

    When I pulled the top of Firefox, this morning, I got a toolbar named Skipity (I think that's the spelling). I went to tools, found and removed, but this is not the point; I want to know where it comes from and who authorized its installation. She ap

  • Equium A110: How replaceme hinges

    Hi, I am looking to source replacement hinges for my Toshiba laptop, could someone point me in the right direction that I can't find anything on the net :( Thank you very much

  • HP photosmart all-in-one 24480: cord for all in one printer-scanner

    When I moved recently, I have lost the cord that connects my scanner to the computer tower. I can't understand the type of cord, it must be. Obviously an end must be a male USB connection but I don't know what is the other end. The scanner is equippe

  • No background music in Age of Empires II Collectors Edition.

    There is no background music in AoE II and AoE II Expansion.I tried just about anything and have scoured the internet for people with the same problem.Apparently, the problem is unusual for the collectors edition, as the background music for AoE II r

  • What system to upgrade to?

    I want to speed up my Dell Inspiron 1545 so I upgraded the ram to 4 GB and Im going to completely wipe my computor and install a new 64 bit OS. What I want to know is, what should I do and which work best and keep my computor running OS quickly? Than