Long Running Task ...

I have a requirement where a user kicks off a long running task ( usually 2
to 5 minutes). I want to show a 'In Progress' message while the task is
procesing. The long running process needs to be passed an ArrayList. To
achieve this , I use a ServerSessionPool and a QueueListener.
In the servlet I assign a unique ID to the task , send a JMS message ( with
the serialized ArrayList) on the queue. The servlet returns to the
user saying 'In progress' message . When the user hits refresh , I want to
know if the message has been consumed ( or the process is over ) and
I need get the 'processed' ArrayList back in the servlet. How do I achieve
this ?
Thanks in advance
~ J

instead of asking the user to hit refresh, you can have the browser
automatically refresh the page every X seconds by putting in a header
parameter.
I forgot the actual parameter, but this is pure HTML so look it up in that
spec
Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[email protected]
www.filip.net
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]..
http://dima.dhs.org/misc/LongRunningTask.jsp
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/registration.jsp >>
"John Doe" <[email protected]> wrote in message
news:[email protected]..
I have a requirement where a user kicks off a long running task
usually
2
to 5 minutes). I want to show a 'In Progress' message while the task is
procesing. The long running process needs to be passed an ArrayList. To
achieve this , I use a ServerSessionPool and a QueueListener.
In the servlet I assign a unique ID to the task , send a JMS message (with
the serialized ArrayList) on the queue. The servlet returns to the
user saying 'In progress' message . When the user hits refresh , I want
to
know if the message has been consumed ( or the process is over ) and
I need get the 'processed' ArrayList back in the servlet. How do Iachieve
this ?
Thanks in advance
~ J

Similar Messages

  • Long running task - what do you show?

    There are a lot of discussions about long running tasks. But what do you show in the GUI while these tasks are running? The obvious choice is the standard hour-glass cursor, or a JProgressBar. I'm sure though that there must be other creative alternatives, like a Java2D animation for example.
    Would people like to share what they show during long running tasks?

    I have both Fusion and Parallels on all my machines.  For Windows7, I have found that
    the most recent version of Parallels is much faster and efficient than Fusion.  With
    XP, either one seems just fine.  Also, if Linux is a future consideration, Fusion seems
    to be the better bet.  Parallels has some USB issues when running Linux.
    I have tried Virtual Box, but for my uses, hardware and firmware engineering, it has
    been problematic.
    Since you mentioned Autocad, I would not recommend VirtualBox.  Either of Fusion
    or Parallels should serve you well.  However, graphics performance does seem a
    bit snappier with Parallels than with Fusion.

  • NiDAQ 6008 -- Long running task stability

    I have a small C program using nidaqmxbase, based on the example code provided.
    This runs with a usb connected 6008 on a Red Hat Linux machine. The task is simple, read the analog voltage (differential, reference source 2.5v range) from one channel at 1000hz in blocks of 50 samples. The results are placed into network messages to send to another program for analysis.
    This program works fine, but has a long run-time stability issue when left running for more than about 24 hours continuously (and, for my application I need to capture in realtime 24/7 indefinitly). The symptom observed is that the 6008 stops returning data -- and "lsdaq" shows that the device is no longer seen by the system. Sometimes the green LED stops blinking as well. Has the DAQ crashed? Did some counter overflow and cause the driver to malfunction? I am able to restore function only by physically disconnecting and re-connecting the 6008.
    Thank you
    Andy.

    Hi aws-
    It sounds like the problem you are seeing could be related to bus powering or resource conflicts on your system.  The fact that the failure results in total loss of connectivity with your device certainly seems to indicate a hardware problem.
    You said your code is based on the example code; please verify if an unmodified shipping example fails similarly.  If so, please let us know which program fails and I will attempt to replicate the issue here.  Do you see this problem on multiple computers and/or with multiple USB-6008 devices? 
    Thanks-
    Tom W
    National Instruments

  • How to delay a long running tasks start until display is updated?

    I am having a problem in that a progress bar I want to use to show progress of a long running background process is not showing up for a long time (up to 10 seconds) after the long running process is started. This is in an AIR application and the background process is an external native process, so once it is launched the UI thread is free to run, but the launch of the process can take time.
    Below is the current state of the relevant code.
    In addition to the current format I have also tried using the CREATION_COMPLETE, EXIT_FRAME and RENDER events with the same results.
    If I up the value in setTimeout to 500ms the progress bar displays quickly, but I would prefer to not delay the launch of the background process for no reason.
    If I comment out the loadPorject call the progress bar is displayed instantly.
    Any help is appreciated.
    private function continueLoad(evt:Event):void
         // We are about to start some potentially long running process
         CursorManager.setBusyCursor();
         curPopup = new SyncProgress();
         curPopup.addEventListener(Event.ENTER_FRAME, popupLoadedHandler);
         PopUpManager.addPopUp(curPopup, parentView, true);
         PopUpManager.centerPopUp(curPopup);
         curPopup.stage.invalidate();
    private function popupLoadedHandler(event:Event):void
         curPopup.removeEventListener(Event.ENTER_FRAME, popupLoadedHandler);
         setTimeout(function():void{syncManager.loadProject(mainViewModel.selectedUserItem.id,proj ectFile.nativePath,overwrite);},0);

    DBMS_SCHEDULER is very powerful and can be a bit unwieldy. I tend to use DBMS_SCHEDULER for jobs which are purely 'in the database' i.e. not specifically APEX-related - in addition, I find it's better for stuff that needs to be run regularly without human intervention (some sort of refresh process, daily cleanup etc).
    If you are intending to run this process from APEX as a pseudo "on demand" process (i.e. generated by a user request) and have quite simple requirements (e.g. there's no dependencies on other jobs), it might be worth checking out the apex scheduling API - namely the package APEX_PLSQL_JOB:
    http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_plsql_job.htm#BGBCJIJI
    It generates a unique job number which you can use to reference its progress - plus it's much simpler to use.
    p.s. using DBMS_SCHEDULER, yes the job name has to be unique but you can generate one by either using a sequence or data not likely to be repeated, like the current timestamp.

  • SQL Developer Locking up/Unable to Cancel long Running tasks

    I have had the same problem with a number of versions of SQL Developer (and version 3.2.09). It occurs when trying to cancel a long-running PL-SQL Function or procedure that has been started by 'Run' in SQL Developer.
    Select Terminate in Run Manager does not stop the job. Nor does trying to exit SQLDeveloper; it asks whether I want to kill the job; then doesn't kill it and doesn't exit either.
    Trying to save modifications to anything the process depends on results in SQL Developer locking for ~20 minutes.
    I have to resort to getting a DBA to manually kill the process at the server.
    Is there any possiblity of a workaround or a way of making the PL/SQL not lock so it can be terminated please?
    Thanks

    I have had the same problem with a number of versions of SQL Developer (and version 3.2.09). It occurs when trying to cancel a long-running PL-SQL Function or procedure that has been started by 'Run' in SQL Developer.
    Select Terminate in Run Manager does not stop the job. Nor does trying to exit SQLDeveloper; it asks whether I want to kill the job; then doesn't kill it and doesn't exit either.
    Trying to save modifications to anything the process depends on results in SQL Developer locking for ~20 minutes.
    I have to resort to getting a DBA to manually kill the process at the server.
    Is there any possiblity of a workaround or a way of making the PL/SQL not lock so it can be terminated please?
    Thanks

  • Webkit timeout kills long running tasks

    Hi There
    We have just been forced to refactor/recode a significant
    portion of one of our AIR based RIA's due to an arbitrary decision
    made by the Webkit team to restrict all XML HTTP requests via a
    hard coded, hidden timeout of 60 seconds. This decision not only
    affects AIR but also affects Safari and other browsers based upon
    Webkit.
    Our application performs complex analytic queries which may
    run to a few minutes. Whilst long synchronous requests are not
    generally a good idea for web based solutions, we believe that RIA
    intranet applications are a completely different ball game and
    should not be subject to arbitrary constraints such as these with
    no flexibility or warning. We would not see this behaviour in Java
    / C# or other such application languages, so why are we seeing this
    in Adobe AIR?
    Our MD has understandably questioned the suitability of Adobe
    AIR for future developments of enterprise RIA's, and we are all
    naturally concerned about other "features" being added or removed
    to the Adobe AIR functionality, even indirectly and whether in fact
    we can rely upon Adobe to monitor the stability of their runtime.
    We don't believe it is acceptable for us to tell our customers that
    it was the fault of a component nested within multiple layers of
    the runtime outside of our control and believe that it is equally
    unacceptable for Adobe to stand by and claim the same.
    We are excited about the prospects of investing in Adobe AIR
    for delivering rapid RIAs to our customers, but are we to expect
    similar show stoppers to arise over the coming months or even
    years, and can we trust the Adobe runtime as an "In production"
    solution going forward.
    Mark Robertshaw
    Director
    Oxford Information Labs
    http://www.oxil.co.uk

    Mark,
    Thanks for bringing this to our attention. We, as I'm sure
    you realize, aren't claiming that this sort of thing is ok. And we
    do work hard to maintain the stability of the runtime. However, it
    can be difficult to know a priori everything that we need to keep
    an eye on. That's one of the reasons we have forums like this one
    and we very much appreciate this kind of feedback.
    As for this particular issue, I'll just point out that you
    might consider taking advantage of the flash.net.* APIs to manage
    your network request, at least as a temporary workaround.
    regards,
    Oliver Goldman | Adobe AIR Engineering

  • EJB3 long running task handling

    Dear all,
    Please help me on this,
    We developed application using struts2 ejb3webservice.runing on jboss5.
    This is a hotel reservation system. User make a request to get the hotel listing that is available, ejb3 Stateful get the connection to the web service and retrieve the hotels and process with the pricing then send back to the struts to display it to user. This happens only once for a search. The problem here is the EJB processing takes lots of time if it is more hotels available.
    So I am expecting to implement a solution such as, if the first 10 hotels found return it to user and display while other hotels are processing background In the EJB. Then I can update those results with the user while he/her running over pagination.
    Is this correct solution? If so how can I implement such a thing using EJB? any suggestion please?
    Thanks
    Emil

    I am not a struts expert but I think that if you want a background processing you should use a Message Driven Bean.
    When you receive the client request in your Session Bean, you send a message to the MDB and then continue. While the MDB is processing the result it can send partial data back to the Session Bean.
    Hope it helps.

  • Handle long-running EDT tasks (f.i. TreeModel searching)

    Note: this is a cross-post from SO
    http://stackoverflow.com/questions/9378232/handle-long-running-edt-tasks-f-i-treemodel-searching
    copied below, input highly appreciated :-)
    Cheers
    Jeanette
    Trigger is a recently re-detected SwingX issue (https://java.net/jira/browse/SWINGX-1233): support deep - that is under collapsed nodes as opposed to visible nodes only, which is the current behaviour - node searching.
    "Nichts leichter als das" with all my current exposure to SwingWorker: walk the TreeModel in the background thread and update the ui in process, like shown in a crude snippet below. Fest's EDT checker is happy enough, but then it only checks on repaint (which is nicely happening on the EDT here)
    Only ... strictly speaking, that background thread must be the EDT as it is accessing (by reading) the model. So, the questions are:
    - how to implement the search thread-correctly?
    - or can we live with that risk (heavily documented, of course)
    One possibility for a special case solution would be to have a second (cloned or otherwise "same"-made) model for searching and then find the corresponding matches in the "real" model. That doesn't play overly nicely with a general searching support, as that can't know anything about any particular model, that is can't create a clone even if it wanted. Plus it would have to apply all the view sorting/filtering (in future) ...
    // a crude worker (match hard-coded and directly coupled to the ui)
    public static class SearchWorker extends SwingWorker<Void, File> {
        private Enumeration enumer;
        private JXList list;
        private JXTree tree;
        public SearchWorker(Enumeration enumer, JXList list, JXTree tree) {
            this.enumer = enumer;
            this.list = list;
            this.tree = tree;
        @Override
        protected Void doInBackground() throws Exception {
            int count = 0;
            while (enumer.hasMoreElements()) {
                count++;
                File file = (File) enumer.nextElement();
                if (match(file)) {
                    publish(file);
                if (count > 100){
                    count = 0;
                    Thread.sleep(50);
            return null;
        @Override
        protected void process(List<File> chunks) {
            for (File file : chunks) {
                ((DefaultListModel) list.getModel()).addElement(file);
                TreePath path = createPathToRoot(file);
                tree.addSelectionPath(path);
                tree.scrollPathToVisible(path);
        private TreePath createPathToRoot(File file) {
            boolean result = false;
            List<File> path = new LinkedList<File>();
            while(!result && file != null) {
                result = file.equals(tree.getModel().getRoot());
                path.add(0, file);
                file = file.getParentFile();
            return new TreePath(path.toArray());
        private boolean match(File file) {
            return file.getName().startsWith("c");
    // its usage in terms of SwingX test support
    public void interactiveDeepSearch() {
        final FileSystemModel files = new FileSystemModel(new File("."));
        final JXTree tree = new JXTree(files);
        tree.setCellRenderer(new DefaultTreeRenderer(IconValues.FILE_ICON, StringValues.FILE_NAME));
        final JXList list = new JXList(new DefaultListModel());
        list.setCellRenderer(new DefaultListRenderer(StringValues.FILE_NAME));
        list.setVisibleRowCount(20);
        JXFrame frame = wrapWithScrollingInFrame(tree, "search files");
        frame.add(new JScrollPane(list), BorderLayout.SOUTH);
        Action traverse = new AbstractAction("worker") {
            @Override
            public void actionPerformed(ActionEvent e) {
                setEnabled(false);
                Enumeration fileEnum = new PreorderModelEnumeration(files);
                SwingWorker worker = new SearchWorker(fileEnum, list, tree);
                PropertyChangeListener l = new PropertyChangeListener() {
                    @Override
                    public void propertyChange(PropertyChangeEvent evt) {
                        if (evt.getNewValue() == SwingWorker.StateValue.DONE) {
                            //T.imeOut("search end ");
                            setEnabled(true);
                            ((SwingWorker) evt.getSource()).removePropertyChangeListener(this);
                worker.addPropertyChangeListener(l);
                // T.imeOn("starting search ... ");
                worker.execute();
        addAction(frame, traverse);
        show(frame)
    }

    At the end of the day, it turned out that I asked the wrong question (or right question in a wrong context ;-): the "problem" arose by an assumed solution, the real task to solve is to support a hierarchical search algorithm (right now the AbstractSearchable is heavily skewed on linear search).
    Once that will solved, the next question might be how much a framework can do to support concrete hierarchical searchables. Given the variety of custom implementations of TreeModels, that's most probably possible only for the most simple.
    Some thoughts that came up in the discussions here and the other forums. In a concrete context, first measure if the traversal is slow: most in-memory models are lightning fast to traverse, nothing needs to be done except using the basic support.
    Only if the traversal is the bottleneck (as f.i. in the FileSystemModel implementations of SwingX) additional work is needed:
    - in a truly immutable and unmodifiable TreeModel we might get away with read-only access in a SwingWorker's background thread
    - the unmodifiable precondition is violated in lazy loading/deleting scenarios
    there might be a natural custom data structure which backs the model, which is effectively kind-of "detached" from the actual model which allows synchronization to that backing model (in both traversal and view model)
    - pass the actual search back to the database
    - use an wrapper on top of a given TreeModel which guarantees to access the underlying model on the EDT
    - "fake" background searching: actually do so in small-enough blocks on the EDT (f.i. in a Timer) so that the user doesn't notice any delay
    Whatever the technical option to a slow search, there's the same usability problem to solve: how to present the delay to the end user? And that's an entirely different story, probably even more context/requirement dependent :-)
    Thanks for all the valuable input!
    Jeanette

  • Download content locally when needed by running task sequence functionality with Windows PE.

    I am trying to understand what happens when the "Download content locally when needed by running task sequence" option in chosen on a task sequence deployment. My assumption is that any needed packages would not be identified
    and downloaded until task sequence is kicked off. 
    Using task sequence boot media, it looks likes a package has been obtained before any task sequence has been selected. I am assuming the package was acquired during the WinPE boot process. Can anyone confirm that this is
    the correct behavior when using the "Download content locally when needed by running task sequence" option? If not, how would WinPE be obtaining the PS100292 SCCM package?
    This specific package contains and HTA file. Only one of  several task sequences deployed to the All Unknown Computers make a call to the HTA file. The one that does, the HTA call is the very first step of the task sequence.
    --Tony

    Hi everyone! I figured what was going on here. I was using an ESX VM and the package was stored on the c:\ from previous attempts and troubleshooting. Long story short, I had to rip the HDD from the VM and add a new one to set every thing back.

  • No display due to long running Actions

    Hi,
    I have a small issue in my application.
    Please help providing the solution for the following problematic scenario faced in my application.
    My project is generally a report generation project,
    arch used: our-own architecture(similar to struts)
    Server: deployed in tomcat server..
    On clicking a button from X.jsp, it triggers the action with the request = REQ1
    so in my configuration Xml file it checks for it and executes the corresponding Action classes and it should display the Presentation(Jsp)
    What happens is , the action class execution is taking more than 10 min, becaz of which i am getting blank screen.
    From the action to jsp , it is executing without any error, which i could see in the log files..
    Actions taken:
    improved the performance of the query, but cudnt reduce much time..
    session time is 180min, and connection timeout set to an hr. - No change- It seems this doesnt have to do anything with this.
    my Observance:
    I guess, as per arch, it is executing till jsp, but it seems that HttpRequest is getting timedout becaz of long running actions.
    Please help to find the cause and approach method to resolve this issue.
    Note: no issues to wait till 10min.. but need to get the values (reports) in the screeen..
    Thanks in advance.....

    Design is inappropriate.
    Long running processes, and specifically reports, shouldn't rely on session connections.
    Instead the following should be done.
    - Process initiation (user request), post a task request to a task request queue. Return a unique identifier to requestor.
    - Separate process processes tasks in the task queue.
    - Requestor (such as a gui) periodically polls using the indentifier to see if the task is complete.
    - When the task is complete the requestor asks for the results (GUI displays them.)
    The problem with extending timeouts is that there are valid error scenarios where long timeouts will mean resources not returned to the system for long periods of time when they should have been.
    Per your current solution there is probably some other timeout somewhere. Could be several. The JSP forum might be a better place to ask where all of the possible timeouts could be.

  • Does win8/8.1/10 kill long-running programs automatically as stated in specs? reasons why?

    does win8/8.1/10 kill/end-task long-running programs automatically as stated in specs? how specifically does it detect a locked-up process?
    has this been put into windows 7 at any time to make it similar to windows 8?
    Please supply accurate answers. thank you.
    My understanding the reason for this change was to handle locked-up programs.
    I do have a number of long-running processes. some examples of mine and scenarios for other users:
    simulations on a Workstation or HPC Server
    doing a directory tree walk on a hard disk with >=1TB of data
    reference articles I have found on the subject:
    windows 7
    http://windows.microsoft.com/en-us/windows/exit-program-not-responding#1TC=windows-7
    windows 8
    From some of what I understand, you can also get the "Program Not Responding" or similarly titled dialog box when:
    bug in the source code of the program in question. for instance, while(1){} such as forever loops (win7)
    similar program bug when declaring a function one way but defining it a different way and then calling it (mismatch in function signature) (win7)
    similar to above with DLLs in using MSVCRT*.DLL or other
    (?) can't remember for sure on this, but I think some badly formed calls or it was invalid values or data type mismatch to Win32 API can do this from buggy code. (win7)
    for (x=0; x < 16777216; x++) {your code here...} in other words, large values for loop termination (win7)
    this is a repost of http://answers.microsoft.com/en-us/windows/forum/windows_8-performance/does-win88110-kill-long-running-programs/d35c3c9e-c6f4-4bbf-846a-2041bf2167a0?tm=1427518759476
    here due to a request to do so.

    does win8/8.1/10 kill/end-task long-running programs automatically as stated in specs? how specifically does it detect a locked-up process?
    has this been put into windows 7 at any time to make it similar to windows 8?
    Please supply accurate answers. thank you.
    My understanding the reason for this change was to handle locked-up programs.
    Hi Jim,
    First, I have to admit that I'm not fully understanding the question, If a program is not responding, it means the program is interacting more slowly than usual with Windows, typically could be a confliction of software or hardware resources between
    two programs, lack of system resources, or a bug in the software or drivers. In that case, we can choose to wait or end the program. This design is similiar in Windows 7, Windows 8 and other OS.
    For deeper analysis, system determines whether the system considers that a specified application is not responding using a "IsHungAppWindow function",
    https://msdn.microsoft.com/en-us/library/ms633526.aspx
    And this link also give some explanation: Preventing Hangs in Windows Applicationshttps://msdn.microsoft.com/en-us/library/windows/desktop/dd744765%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    While I'm not a developer, to better understand this, I recommend you contact members in the MSDN Forum:
    https://social.msdn.microsoft.com/Forums/en-US/home
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Long running table partitioning job

    Dear HANA grus,
    I've just finished table partitioning jobs for CDPOS(change document item) with 4 partitions by hash with 3 columns.
    Total data volumn is around 340GB and the table size was 32GB !!!!!
    (migration job was done without disabling CD, so currently deleting data on the table with RSCDOK99)
    Before partitioning, the data volumn of the table was around 32GB.
    After partitioning, the size has changed to 25GB.
    It took around One and half hour with exclusive lock as mentioned in the HANA adminitration guide.
    (It is QA DB, so less complaints)
    I thought that I might not can do this in the production DB.
    Does anyone hava any idea for accelerating this task?? (This is the fastest DBMS HANA!!!!)
    Or Do you have any plan for online table partitioning functionality??(To HANA Development team)
    Any comments would be appreciate.
    Cheers,
    - Jason

    Jason,
    looks like we're cross talking here...
    What was your rationale to partition the table in the first place?
           => To reduce deleting time of CDPOS            (As I mentioned it was almost 10% quantity of whole Data volume, So I would like to save deleting time of the table from any pros of partitioning table like partitioning pruning)
    Ok, I see where you're coming from, but did you ever try out if your idea would actually work?
    As deletion of data is heavily related with locating the records to be deleted, creating an index would have probably be the better choice.
    Thinking about it... you want to get rid of 10% of your data and in order to speed the overall process up, you decide to move 100% of the data into sets of 25% of the data - equally holding their 25% share of the 10% records to be deleted.
    The deletion then should run along these 4 sets of 25% of data.
    It's surely me, but where is the speedup potential here?
    How many unloads happened during the re-partitioning?
           => It was fully uploaded in the memory before partitioning the table by myself.(from HANA studio)
    I was actually asking about unloads _during_ the re-partitioning process. Check M_CS_UNLOADS for the time frame in question.
    How do the now longer running SQL statements look like?
           => As i mentioned selecting/deleting increased almost twice.
    That's not what I asked.
    Post the SQL statement text that was taking longer.
    What are the three columns you picked for partitioning?
           => mandant, objectclas, tabname(QA has 2 clients and each of them have nearly same rows of the table)
    Why those? Because these are the primary key?
    I wouldn't be surprised if the SQL statements only refer to e.g. MANDT and TABNAME in the WHERE clause.
    In that case the partition pruning cannot work and all partitions have to be searched.
    How did you come up with 4 partitions? Why not 13, 72 or 213?
           => I thought each partitions' size would be 8GB(32GB/4) if they are divided into same size(just simple thought), and 8GB size is almost same size like other largest top20 tables in the HANA DB.
    Alright, so basically that was arbitrary.
    For the last comment of your reply, most people would do partition for their existing large tables to get any benefit of partitioning(just like me). I think your comment can be applied for the newly inserting data.
    Well, not sure what "most people" would do.
    HASH partitioning a large existing table certainly is not an activity that is just triggered off in a production system. Adding partitions to a range partitions table however happens all the time.
    - Lars

  • Explain for a very long running query

    Dear gurus,
    I have an issue with a long running query which takes around 2 hrs to execute. The tables being used here pertains to 11i, so there is no scope of indexing.
    SELECT peia.expenditure_item_id, DECODE (peia.system_linkage_function, 'ST', 'TIME', 'EXP' ) AS CATEGORY,
    pea.incurred_by_person_id AS employee_id, emp.attribute6 AS q_number, NVL (emp.employee_number, npw_number) AS employee_number, emp.full_name AS employee_name, peia.project_id,
    ppa.segment1, ppa.NAME, func_get_proj_attribute (peia.project_id, NULL, 'PROJECT ENTITY NAME' ) AS project_entity,
    func_get_proj_attribute (peia.project_id, NULL, 'PROJECT MANAGER') AS project_manager,
    DECODE (ppa.distribution_rule, 'WORK/WORK', 'TM', 'WORK/EVENT', 'TM with Milestone' ) AS project_classification,
    ppa.project_type AS funding_type, func_get_proj_attribute(peia.project_id, NULL, 'CUSTOMER GROUP' ) AS customer_group,
    func_get_proj_attribute(peia.project_id, NULL, 'ACCOUNT MANAGER' ) AS account_manager,
    pt.top_task_id, func_get_task_attribute(pt.top_task_id, 'TASK NUMBER' ) AS task_number,
    func_get_task_attribute (pt.top_task_id, 'TASK NAME' ) AS task_name, peia.expenditure_item_date, peia.projfunc_raw_revenue AS func_raw_revenue,
    peia.accrued_revenue AS func_accrued_revenue, peia.projfunc_currency_code,
    DECODE (peia.project_raw_revenue, NULL,
    DECODE (peia.system_linkage_function, 'ST', peia.quantity* NVL (peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id,
    peia.expenditure_item_date )
    peia.quantity
    peia.project_raw_revenue
    ( peia.accrued_revenue
    / peia.projfunc_raw_revenue
    * peia.project_raw_revenue
    ) AS project_accrued_revenue,
    ppa.project_currency_code,
    NVL(peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id, peia.expenditure_item_date)
    ) AS bill_rate,
    peia.rev_dist_rejection_code, SYSDATE AS generated_date
    FROM pa_expenditures_all pea
    INNER JOIN (SELECT * FROM per_all_people_f WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date) emp ON NVL(pea.incurred_by_person_id, 61) =emp.person_id
    INNER JOIN (SELECT * FROM pa_expenditure_items_all WHERE billable_flag = 'Y' AND quantity <> 0) peia ON pea.expenditure_id =peia.expenditure_id
    INNER JOIN (SELECT * FROM pa_projects_all WHERE project_status_code = 'APPROVED' AND distribution_rule IN ('WORK/WORK', 'WORK/EVENT')) ppa ON peia.project_id =ppa.project_id
    INNER JOIN pa_tasks pt ON peia.task_id = pt.task_id;
    The explain plan for this is:
    SELECT STATEMENT CHOOSECost: 26,758 Bytes: 53,373,971 Cardinality: 245,963                          
         9 HASH JOIN Cost: 26,758 Bytes: 53,373,971 Cardinality: 245,963                     
              1 TABLE ACCESS FULL TABLE HR.PER_ALL_PEOPLE_F Cost: 67 Bytes: 546,900 Cardinality: 9,115                
              8 HASH JOIN Cost: 26,581 Bytes: 20,174,029 Cardinality: 128,497                
                   2 TABLE ACCESS FULL TABLE PA.PA_TASKS Cost: 596 Bytes: 856,370 Cardinality: 85,637           
                   7 HASH JOIN Cost: 25,691 Bytes: 18,889,059 Cardinality: 128,497           
                        3 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURES_ALL Cost: 1,524 Bytes: 5,220,330 Cardinality: 522,033      
                        6 HASH JOIN Cost: 23,701 Bytes: 17,604,089 Cardinality: 128,497      
                             4 TABLE ACCESS FULL TABLE PA.PA_PROJECTS_ALL Cost: 91 Bytes: 49,059 Cardinality: 621
                             5 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURE_ITEMS_ALL Cost: 23,575 Bytes: 68,913,570 Cardinality: 1,188,165
    Can anyone suggests what can be done to improve this query?
    Thanks in advance
    SA
    Edited by: user593719 on Oct 5, 2010 10:29 AM
    Edited by: user593719 on Oct 5, 2010 10:30 AM

    1) Your inner joins are doing record selections that could be done on the Join's ON clause.
    2) Look at your functions to see if you can get performance improvements using parameterized CURSORs & adding DETERMINISTIC to the definition.
    3) Consider using WITH to first pull your data & then running your functions.
    For example:
    with
    smiths as (
    select *
    from hr.per_all_people_f papf
    where papf.first_name='Smith'
    select *
    from smiths
    where trunc(sysdate) between effective_start_date and effective_end_date;
    In general, pare down your data first. Whatever will restrict your data most, start with selecting that table/view.

  • Canceling long running queries

     

    This definitely occurs in 1.5.5 - in my particular case, and this is really strange, if one uses Task Manager to shut down SQLDeveloper because it is just taking forever to get a Data view (via the + expand sign on the side of a given admittedly big table, then clicking on the Data tab), SQLDeveloper freezes. Even if I start a new instance of SQLDeveloper, and ask for a Data view again, it freezes - I've waited as much as 1/2 hour, where as in prior days I'd get a response within say 1 min.
    I've even uninstalled and re-installed. Same deal. This is what's the strangest by far. How can it be that SQLDeveloper remembers that a long running query was once canceled even after an uninstall / reinstall ? I could not find anything remotely related to this in the Registry after the uninstall either.
    [By the way, if on the other hand, I say SELECT * FROM {table_name}, I get an instant response !]

  • Need SSIS event handler for long running event

    Hi,
    I have a long running table load task that I would like to monitor using an event handler. I have tried the progress and information events but neither generates a message during the actual table load. Is there a way to invoke an
    event during the SSIS data flow task when it 1%, 2% done?
    thanks
    oldmandba

    Do you now how many rows the source table have ? You can run SELECT statement on the destination to find out how many data has been inserted.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • FSCM-COL: Cleared invoices in Payments Tab

    Hi all, We have a requirment here where our client wants to check all the invoices, even the cleared oneu2019s in the Process Receivables view. Now, in the u201CInvoicesu201D tab we only have the open items and in the u201CPaymentsu201D tab we only h

  • Unable to get new Apps after purchasing iPod Touch app update

    I know this is a frequent topic but I can't help but feel my situation is a little different to others I've read. After purchasing the app update the new apps failed to appear. I also had a USB port problem at the time that prevent a correct sync - a

  • Logical corruption of block

    Dear Experts Can you pls help in understanding of logical block corruption in detail. Thanks Asif Husain Khan

  • Report on Process Chain Completion Timings

    The SAP-delivered BW stat cubes do not seem to be designed to report on process chain completion timings.  My requirement is to automatically generate a report on the start time, end time and over-all duration of our scheduled chains and if possible,

  • Problems after installing updates

    Hi, Help, please! I installed Apple Security Update 2007-003 on March 19, along with the iTunes and Quicktime update recommended by Apple. Since then some of my system software is not working. My menu clock doesn't run and I can't burn CDs are two ex