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.

Similar Messages

  • 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

  • How to research a long running job from 3 days ago

    Re: How to research a long running job from 3 days ago
    Client called to say that a job that normally runs for 6 hours ran for 18 hours on 11/01. 11/01 was a Saturday, and end of month. The long running job writes to a log and I can from the log that that the problem started right around 10:43am. Every step
    before 10:43 was taking the normal amount of time. Then at 10:43 a step that takes seconds hung for 12 hours. After 12 hours the step finished and the job completed successfully.
    I looked at the SQL Log, Event Log, Job History (for all jobs). What else can I look at to try and resolve an issue that happened on 11/01/2014?

    It does execute an SSIS package.
    Personally I feel this as kind of bug in SSIS package but I am not expert in SSIS so I would move it to SSIS forum. Please update your question giving complete information what SSIS package does.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Re:How to determine the long running jobs in a patch

    Hi ,
    How to determine the long running jobs in a patch .
    Regards

    Hi,
    Check the below MY ORACLE SUPPORT note:
    Note.252422.1 .... Check Completed Long Running Jobs In Oracle Apps.
    Best regards,
    Rafi

  • 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.

  • How to change which programs run at start up

    Hello,
    I am just trying to speed up and clean up my machine.  I would like to know how to control which programs run at start up.  Also any other suggestions on how to keep everything running smoothly and effifiently.  General maintenance type stuff.
    Thanks, Jason

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; make them independent of each other. Don’t rely completely on any single backup method, such as Time Machine.
    2. Keep your software up to date. In the Software Update preference pane, you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis. This is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” “extenders,” “cleaners,” “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” or "utilities." With very few exceptions, this kind of material is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.
    The free anti-malware application ClamXav is not crap, and although it’s not routinely needed, it may be useful in some environments, such as a mixed Mac-Windows enterprise network.
    4. Beware of trojans. A trojan is malicious software (“malware”) that the user is duped into installing voluntarily. Such attacks were rare on the Mac platform until recently, but are now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must be acquired directly from the developer. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from a web page without your having requested it should go straight into the Trash. A website that claims you have a “virus,” or that anything else is wrong with your computer, is rogue.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most users don't.
    5. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” “rebuilding the directory,” “running periodic scripts,” “deleting log files,” “scanning for viruses,” or “repairing permissions.” Such measures are for solving problems as they arise, not for maintenance.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • How can find out long run quries?

    Hi,
    I have some question
    how can find out long run queries , i have use v$session but i have not find out,pls how can find out
    these queries.

    v$session_longops has some limitations, for example it records only some operations see more [url http://www.gplivna.eu/papers/v$session_longops.htm]here
    Another possibility might be using statspack and/or [url http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#PFGRF02601]AWR
    From docs:
    The most current instructions and information on installing and using the Statspack package are contained in the spdoc.txt file installed with your database. Refer to that file for Statspack information. On Unix systems, the file is located in the ORACLE_HOME/rdbms/admin directory. On Windows systems, the file is located in the ORACLE_HOME\rdbms\admin directory.
    Gints Plivna
    http://www.gplivna.eu

  • HT4528 How do you close programs running in the background after you update to the ios7?

    How do you close programs running in the background after you update to the ios7?  It no longer works to tap the button twice

    double tap the home button, and swiipe upp on the app screenshot

  • Music on iPhone4 4 automatically shuffles music and shuffle is not turned on in anyway. Anyone know how to fix this or is anyone having the same problem? This didn't start until the big update a month ago!!

    Anyone know how to fix this or is anyone having the same problem? This didn't start until the big update (5.0) a month ago!!
    When playing music there is no shuffle button like there was before... On the playlist there is a shuffle bar but this does nothing when I touch it. It's either stuck on my music is messed up.
    Any ideas??

    Start playing a song.
    Select the album artwork area for the song playing to reveal the scrubber for the song.
    Is the color of the icon located at the right of the scrubber blue?
    If so, that is the shuffle icon and blue means shuffle is on. Select the icon to turn shuffle off. White means off.

  • 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

  • How can i cancel long running queries (red x doesnt work)

    hi there
    i am trying to work with some long running queries - it would be very nice to be able to cancel them (like toads cancel button)
    I have tried the red X in the circle but it doesnt seem to work - it appears to have cancelled it (the cylon-eye style comfort bar stops ocillating) but if i try to use the connection again, or disconnect or open another connection it says:
    "connection currently busy. Try again?"
    i have tried this in the latest release vanilla & the latest release plus patch 2
    thanks
    Martin

    Good news that this will be improved. Can't resist to post this Link: [plsql forum thread about start/stop.. | http://forums.oracle.com/forums/thread.jspa?forumID=75&threadID=927697]
    I have experienced the same and also noted that it feels better to execute stored procedures in sqldeveloper
    - by editing
    - compiling (might hang if already busy)
    - run from the same dialog just to get the the cylon's eye for emergency stops (which waits .... ) meanwhile jump to apex to fiddle with small table triggering exception to stop the procedure.
    If stored procedure is executed from the list via 'right mouse click'-style then you see in the log-region "connecting to databse ... ." but no method to stop nor cancel or cylon's eye is well hidden.
    When such "busy" is running I also noted that the database-connection right mouse click has greyed/inactivated the selections "connect/disconnect" so the next logical step for stopping via "disconnect" is out of the question.
    I think this also boils down also to question whether the user has rights to see gv$session and be able to drop/stop busy/jamming sessions. E.g. public synonyms listing has small icons with mystic red :)
    /paavo
    Java(TM) Platform     1.6.0_14
    Oracle IDE     1.5.4.59.40

  • 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 do you fix a run dll starting c user owner

    i keep getting a run dll starting c user owner

    Hi
    There is only one user in this laptop and it is a admin account
    There is 213GB of capacity on the computer.
    I've also tried turning off all the anti-virus and computer maintenance stuff
    Don't know that that is the problem...
    But what ever it is it will stop me from buying CC because I can't install it!

  • How does Flex handled long computation tasks?

    Hi
    I am using Flex3 with Java. I need to print a large document after doing some processing on it, which require about 15 seconds(varying depending on size of document). Currently, the browser will hang for around 15 seconds and after that the printing starts.
    I want to figure out how to take care of the following items
    User should be able to execute long tasks, even if the cumputaion time takes longer time, say 1 min.
    Any option for multi-threads, so that i can split the processing job to minimise the computation time.
    Option to Cancel the execution in between.
    Avoid the freezing of UI - currently, my browser is getting stuck while flex executes the print job
    Also, can I incrementally render the browser with some data during the ciompuutaion so as to engage the user to reduce the effect of computaion delay.
    Thanks
       Rakesh

    Unfortunately, the current Flash Player does not support multiple threads in ActionScript. However, the Player team is aware of the desire by developers for some form of concurrent processing and they're thinking about how to satisfy it.
    In the meantime, if you have a lot of ActionScript to execute, you have to develop some kind of "green threading" (http://en.wikipedia.org/wiki/Green_threads) of your own, or find a library that does it. The basic idea would be to use an enterFrame handler (or a Timer) and a work queue to do only a reasonable amount of computation per frame.
    Gordon Smith
    Adobe Flex SDK Team

  • 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

Maybe you are looking for