Database queries - is there a wait or sleep functionality?

Hello everyone,
I have recently encountered a problem where a database collector I made
just stops querying after a while and needs restarting in the ESM for it
to work again. In other databases (I am querying Oracle btw), this does
not happen and in some others it does. So I am basically thinking that
some databases are configured to limit the amount of querying or force
an exit on error.
What I have noticed, is that in my Oracle environment (no fancy
configurations, all very permissive) I get alot of ORA-0100 errors
indicating that there are too many open cursors. This happens when the
last row in the database has been reached and the errors stop being
shown in Active Views only after some data is inserted in database and
collector resumes normally the task of collecting data until no more
records are available and once more errors appear in Active Views.
I altered the amount of allowed open cursors and incremented from 300
to 500. Still, I keep getting errors (like every 20 seconds). I want to
minimize these amount of errors and hopefully solve my original problem
of having to manually restart the collector in some customer
environments. I came up with the following snippet (bottom of message),
but can't seem to find a function for having the collector sleep or
wait. I tried Thread.sleep() (From Java) and setTimeout() (From
Javascript) but both raise errors since they are undefined methods for
the collector.
The Sentinel API makes reference to "queryDelay" and "queryScheduled"
flags which are supposedly defined in sqlquery.js. I cannot find any
reference in the code to these flags and I am not even sure of how to
implement them ( if(!queryDelay) { conn.send(DBQUERY) } ?????? ).
How can I use these flags in the code to help me reduce the number of
queries being thrown when there is no data? Or will I have to hack my
own sleep or wait function? I appreciate any assistance!
snippet of code I want to implement:
Code:
Connector.prototype.sendQuery = function(){
if (rec.CONNECTION_STATUS == "NEED-QUERY") {
if (instance.CONFIG.myCounter >= 3) {
//HERE INSERT A SLEEP OR TIMEOUT FUNCTION
instance.CONFIG.myCounter = 0;
} else {
conn.send(instance.CONFIG.DBQuery);
//instanced in initialization function. Resets to zero when query is successful.
instance.CONFIG.myCounter = instance.CONFIG.myCounter + 1;
return true
Jean-Paul_GM
Jean-Paul_GM's Profile: http://forums.novell.com/member.php?userid=12809
View this thread: http://forums.novell.com/showthread.php?t=445597

I experience the same problem with my custom collector.
But the beta connector is not there anymore.
Can you please provide the connector so that I can test if it solves my
problem.
Thanks.
ab;2141610 Wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> If this works I'd like you to open an SR for it so we can link it to
> the
> bug, but in the meantime:
>
> 508a0b25988c98a152ff5889edb41882 jdbc2011.1r1beta2.tar.gz
>
> ftp://ftp.novell.com/outgoing/jdbc2011.1r1beta2.tar.gz
>
> This is a beta and has not been fully ZA'd but seems to resolve your
> issue for another customer. If it does please be sure to at least
> post
> back here if not open an SR (which will be credited to you as this is
> Bug# 700669 most likely).
>
> Good luck.
>
> - --
> Want to yell at me in person?
> Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.15 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - 'Enigmail: A simple interface for
> OpenPGP email security' (http://enigmail.mozdev.org/)
>
> iQIcBAEBAgAGBQJOge8eAAoJEF+XTK08PnB5ORoQAJcX9moFMh AfcpLSaIVhFLFj
> ZcmfRjJs4IyT+xatk9wp1S/+eq81AMuyxsoGK/RQfwkKQtzJWiUtQAulCVPjFJZP
> 3Hy2yBAJYUe5Rm3kedfeFlW3vFIV7wecl4el1UPRs4Q9DBUuBa XqP1KHgDrx4iue
> ECEph0scQmlp+SxeBUZKfVwWY9NRKio3kxRPJ3QmzPPQ8euP6Z RYcDtwfJq4rrQf
> z8GcV4ylHZxgIqGXI2pV47zBPPuU/lppytAnyaZSQm5ODs1ndi8f7i/MLPZ4SGI4
> rkjUURVmkYim7UOA6QLxYUxUJF5SDGyjyJS2h2wGb5caBACMsA XDeySZ6ARMxtqs
> 9mzb+Zj3VC4+54yVFAXDUq7mzMa5NE0WqxTR9lNoBMnnLmjwyk b9YDfmDUFZCpmT
> QtWM68bgqtl/p1kcjQq0yAsTVTniGsOynpfTvZjsi4Y4hDCC9ktf8HP7aqu+Tb Nn
> ehVYbG8zM8muUfiAEMTfjm7X07DK5uTTduNnnCbysnvNcCdRlu SEinfZsDRiihEt
> gdoYFRYicy3SrJTL769TlzlKd3LU8ICqy8fnHLVeJjPanWxRCQ ISFUuhb5NI1h8Q
> unVZAzHzcpJCidMLm/cOpCVbyPeaTeG3HbQzNOqwKyd4FFfHvzIBh0JVzO2uCScf
> nvoosfhMydAkj0sgWXvH
> =AVMR
> -----END PGP SIGNATURE-----
hkalyoncu
hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
View this thread: http://forums.novell.com/showthread.php?t=445597

Similar Messages

  • My iMessages don't work since updating. It says the Messages database is being upgraded, please wait while it finishes or Quit Messages and relaunch it later. How do I get them working again?

    My iMessages don't work since updating. It says the Messages database is being upgraded, please wait while it finishes or Quit Messages and relaunch it later. How do I get them working again?

    Back up all data.
    Quit Messages if it’s running. Force quit if necessary. Relaunch it and test after each of the following steps. If the problem isn't resolved, quit again and go on to the next step.
    Step 1
    Make sure you know the ID and password you use with iMessage. Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Select the login keychain from the list on the left side of the Keychain Access window. If your default keychain has a different name, select that.
    If the lock icon in the top left corner of the window shows that the keychain is locked, click to unlock it. You'll be prompted for the keychain password, which is the same as your login password, unless you've changed it.
    Right-click or control-click the login entry in the list. From the menu that pops up, select
              Change Settings for Keychain "login"
    In the sheet that opens, uncheck both boxes, if not already unchecked.
    From the menu bar, select
              Keychain Access ▹ Preferences ▹ First Aid
    If the box marked
              Keep login keychain unlocked
    is not checked, check it.
    Select
              Keychain Access ▹ Keychain First Aid
    from the menu bar and repair the keychain.
    From the Category list in the lower left corner of the window, select My Certificates. Look carefully at the list of certificates in the right side of the window. If any of them is marked with a red "X" as expired or invalid, delete it. Also delete all items with "iMessage" or "com.apple.idms" in the name, whether valid or not.
    From the menu bar, select
              Keychain Access ▹ Preferences... ▹ Certificates
    There are three menus in the window. Change the selection in the top two to Best attempt, and in the bottom one to  CRL.
    Log out and log back in.
    Step 2
    Hold down the option key and select
              Go ▹ Library
    from the Finder menu bar. Move the following items from the Library folder to the Trash (some may not exist):
              Containers/com.apple.corerecents.recentsd
              Caches/com.apple.Messages
              Caches/com.apple.imfoundation.IMRemoteURLConnectionAgent
              Containers/com.apple.iChat
              Containers/com.apple.soagent
              IdentityServices
    Leave the Library folder open. Log out and log back in.
    Step 3
    Go back to the Finder and move the following item from the open Library folder to the Desktop:
              Messages
    Note: you are not moving the Messages application. You’re moving a folder named “Messages.”
    If Messages now works, delete the Messages folder on the Desktop. Otherwise, quit Messages again. Put back the folder you moved, overwriting the newer one that may have been created in its place.
    Step 4
    In the Preferences subfolder, there may be several files having names that begin with any of the following strings:
              com.apple.iChat
              com.apple.ids
              com.apple.imdsmsrecordstore
              com.apple.imessage
              com.apple.imservice
    Move them all to the Desktop. There may also be a file with the name "com.apple.imagent.plist". Move that to the Trash.
    Also in the Preferences folder, there's a subfolder named "ByHost". Open it and do the same thing.
    Log out and log back in. Test again. This time Messages should perform normally, but your settings will be lost. You may be able to put back some of the files you moved to the Desktop in this step. Relaunch and test after each one. Eventually you should find one or more that causes Messages to malfunction. Delete those files and recreate whatever settings they contained.
    If the issue is still not resolved, quit Messages again and put all the items you moved to the Desktop back where they were. You don’t need to replace the items you moved to the Trash. Stop here and post your results.
    If you later decide that you don’t like the results of Steps 3 and 4, you can undo them completely by quitting Messages and restoring the items you deleted in those steps from your backup.

  • Difference between wait() and sleep()

    hi
    can any one tell me what is the difference between wait() and sleep().
    thanks in advance.

    Mahaboob,
    This question has been asked before; however, I will give you a real life example.
    Imagine you are in a super market and you go to the till to pay by your card, then behind you there are 10 people waiting in queue. You card does not work since you have not supplied the right pin code; there are two option
    1- Sleep
    2- Wait
    1- If you sleep you will lock the till for your self and try to figure out the pin number while the queue behind you increase on the resource (till)
    so you are engaging the till and wasting its time and wasting the till machine resource (CPU)
    2- you are polite, you move aside and wait so so that others can use the resource (till) until somebody in the queue finishes ( a good person) and give you a shout to tell you come in to the till to process your payment; you wake up and enter the pin number and go out from the super market.
    Now when you sleep, the current thread locks the resource so no body can use it and wast the CPU time
    while wait make the current thread release the lock on the object and does not ( this thread) actually wast the CPU time
    There are much more explanantion, try to search this forum.
    Regards,
    Alan Mehio
    London,UK

  • Using wait or sleep without a thread

    Is there any method to do the equivalent of a wait or sleep without using threads?

    You have a single-threaded application executing, and
    you want to pause it at a given location for a given
    period of time. If you call sleep, you give up
    execution, which you don't want to do.What do you mean by not wanting to give "up execution"? It is the scheduler of your OS that decides when your program executes or not. Your code snippet does nothing but burn processor time (incidently pretending to the scheduler that it actually has something useful to do) which could be well used by some other process running on the computer. Use Thread.sleep instead, thats what it is there for. If you want to somehow affect the amount of processor time that the scheduler allocates to your process you will be better served by increasing its priority.
    having my skill and/or intelligence mocked Well, I have certainly not mocked your skill nor your intelligence, god knows that I have on occasion presented poor solutions in this and other forums, but lets not dwell on that...

  • Wait() vs sleep()

    This is a purely general question, I was wondering which is better to use: sleep() or wait()?

    Use sleep() if you just want to wait for some time,
    for example if you want to wait before you retry to
    create a socket connection when the first try failed.
    This is wrong. Never use sleep when you are using synchronization, it could cause deadlocks. Instead, use wait as wait will release all your locks and thus reduce the chance of deadlock. Remember that your thread may be holding locks that you are unaware of so it's best to wait (not sleep).
    Use wait() if you want to synchronize multiple
    threads, for examplw when one thread has to wait for
    the resutl of another thread. >
    So fi you have only one thread ( and i assume that
    have you never written a multithreaded app) just use
    sleep() adn forget wait(). They might look similar but
    serve quite different purposes.
    Java is multithreaded by nature, it's impossible to write a non-multithreaded application in java as there are at least a few threads ( finalizer thread, GC thread, your main thread). And any non-trivial java program will have at least 2 threads. Any java application that uses swing has at least 7 threads. So you must expect that your code will be run in multiple threads and thus sleep is not a good choice.
    I don't think that using sleep should be recomended because it doesn't release locks.

  • Why is there a "waiting" App on my iPhone 5s?

    Why is there a "waiting" App on my iPhone 5s? Is it going to use up my data?

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Topic about wait(),join(),sleep() and yield()

    Hi there,
    I'm headache with the implementation of wait()��join()�� sleep() yield(). Can anybody tell me:
    1. what's the difference between wait() and join(), I can't see it.
    2. As I know if thread A waits on thread B then A will release the lock. How about join, or slepp, or yield?
    3. Why use notify()? As I see if thread A waits on thread B, when B completed without calling notify(), the A will continue its job!!
    thanks thanks thanks

    1. Object.wait() will make a thread wait until Object.notify() is called on the object. Thread.join() will make the running thread to wait until the thread object finish to execute.
    2. .wait() does not wait on thread, it wait on objects. .sleep(long timeout) is about the same as .wait(long timeout), except that it need to be awaken with a .interrupt, not .notify. Also you cannot awaken more than one thread with a .interrupt, while a call to .notifyAll() will awaken all threads waiting on that object. .yield() suspend the current thread only to give a chance to others thread to execute and the initial thread will continue ot execute only a hort time after the .yield().
    3. See #1, #2 and think a bit.
    Regards

  • Can I use RECOVER database command evenif there is no MEDIA FAILURE? [b]Urg

    I need an urgent help from all the big guns out there?
    My database is up and running, but still I want to recover the deletion of data that has been done on FRIDAY/SATURDAY/SUNDAY/MONDAY/TUESDAY/WEDNESDAY in other words I want the FRIDAY's state of the database.
    Can I do it using the
    "RECOVER DATABASE UNTIL TIME '2005-28-06-00:00:00' command?
    Please guide me.
    Thanks in advance

    Hi,
    i assume you running your database in archive log mode and using rman to accomplish you task.i would say that you can recover your database even if there is no media faliur occurs,no doubt you can use this.i think you want to recover your database to the fridays state prior to the table deletion,so you get the tables back in your database.so what's a problem execut following.
    run {
    SET UNTIL TIME "TO_DATE('apr 03 2005 01:17:13','MON DD YYYY HH24:MI:SS')";
    restore database ;
    recover database ;
    asuume in this example that you want to recover your database up to date aprail 3 and prior to 01pm time.
    change the code according to your requirement.
    thanks.

  • Requiring several database queries for my GUI - where to put the reads?

    Requiring several database queries for my GUI
    Hi all,
    I am to create a GUI with a couple of drop downs
    These are populated from database queries, as well as the main program reading from the database based on all inputs in the GUI.
    Should I put all database reads into a class as seperate methods.
    e.g,
    one method for the database read to populate the first combo box.
    a second method to take the choice from combobox 1 and read from the database to populate combobox 2
    a third method to then perform the main database read based on GUI selections from the above two methods..
    is this the 'right' way to do it.
    my GUI would then be in a sperate class.
    or should I sperate the 3 database reads into 3 different classes?
    thanks in advance,
    Matt

    BigDaddyLoveHandles wrote:
    walker8 wrote:
    You might also read some info on three tier design using MVC (Model, View, Control) if i recall correctly.
    Here's an article by Martin Fowler on GUI architecture: [http://martinfowler.com/eaaDev/uiArchs.html]
    awesome! that's just what i needed. i haven't read all of it yet but it gives me ideas about the classes i need.
    regards
    walker8

  • Replace the wait with java embedding thread.sleep() function

    Hi,
    How to replace the wait with java embedding thread.sleep() function. Can anyone help.
    Thanks.

    drag and drop the java embedding component
    include the following code in it.
    try{ 
    Thread.sleep(60000);
    }catch(Exception e)
    --Prasanna                                                                                                                                                                                                                                                                                                                           

  • I purchased 2 weeks before i phone 5 but there is problem with sleep and wake up button its not responding can anyone help me in this issue.

    i purchased 2 weeks before i phone 5 but there is problem with sleep and wake up button its not responding can anyone help me in this issue.

    You have a one-year hardware warranty & 90 days of free phone support. Take advantage of it, make an appointment at an Apple store or call AppleCare.

  • TS1702 Apps will not download on my iPad they just sit there in waiting mode.  Help

    Apps will not down load on my iPad,just sit there in waiting mode. This includes updates.

    Your iPad can only update one app at a time.
    Two solutions come to mind.  The first may work; the second should certainly work:
    1.  Try clicking on each of the updating apps to get it to the "Paused" state.  Then, one at a time, click on an app which should resume its download, then let it install and complete.  Then go the next app and repeat.
    2.  Reset your iPad.  Hold the home and on/off buttons together for 6 or 7 seconds till the Apple logo appears.  Then, once the iPad is reset, start the process to get one app at a time downloaded and installed.

  • Is there anybody out there who is still using Appleworks Database and is there a good alternative?

    Is there anybody else out there who is still using Appleworks Database and is there a good alternative?

    There is no replacement program that will directly read Appleworks database files.
    You have two options:
    1.  Continue to use Appleworks 6.2.9, which requires Rosetta installed in Snow Leopard, or the access to Rosetta by installing Snow Leopard Server in virtualization for use in Lion, Mt. Lion or Mavericks:
                                       [click on image to enlarge]
    2.  Export your database information into a common export function (such as delimited ASCII text file) and build a new database file in an alternate database program (such as Filemaker Pro) and import your information into it.  More information here:
    http://www.wilmut.webspace.virginmedia.com/notes/aw/page5.html

  • Hi..I have just recently got an iPhone and I had installed some apps already but now when I try to install and download any apps it just sits there on "waiting" and will not download.. Im able to erase it but no apps will download now. What Do I do?

    Hi..I have just recently got an iPhone and I had installed some apps already but now when I try to install and download any apps it just sits there on "waiting" and will not download.. Im able to erase it but no apps will download now. I have tried logging out of the app store but it still did the same thing. I also tried resetting it and that didn't work either. I've tried everything I can think of but still just sits there saying "waiting." what do I do?

    - Maybe here:
    iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting
    - Try redownloading the app directly to the iPod by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Sleep Function in PL/SQL

    Hi Guys,
    I am creating a procedure which will check for the fileld in the database and if it returns NULL should go to sleep for 15 minutes and then will again check for the field. I am planning to use DBMS_LOCK.SLEEP function. Please can you suggest if the same is fine or advise if in case there is any other specific function which I require to use as I have read that the mentioned function is not accurate in calculating the SLEEP time.
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6019886867656]
    Best Regards,
    Shaz

    Summary of DBMS_LOCK Subprograms
    Table 53-3 DBMS_LOCK Package Subprograms
    Subprogram Description
    ALLOCATE_UNIQUE Procedure
    Allocates a unique lock ID to a named lock.
    CONVERT Function
    Converts a lock from one mode to another.
    RELEASE Function
    Releases a lock.
    REQUEST Function
    Requests a lock of a specific mode.
    SLEEP Procedure
    Puts a procedure to sleep for a specific time.
    PL/SQL lock timer
    Definition: This Wait-Event represents the amount of time a user or application has “slept” through the USER_LOCK.SLEEP or DBMS_LOCK.SLEEP procedures.
    When investigating Oracle Wait-Events, the lion's share of time is spent looking at those events where applications consume precious system resources or are in direct contention with other users or applications. These resource waits revolve around excessive CPU, memory, or disk usage. Events that spin for Oracle internal structures such as latches or enqueues can also be of concern. As their name suggests, Wait-Events DO ‘wait’ on some event to complete before a user or application can continue with its work. Contention for system resources will overwhelm Oracle’s ability to immediately process the SQL and ultimately cause applications to accumulate time in resource specific Wait-Events.
    On the flip-side of resource waits there are what are called idle events. These events do not wait for any specific resource but record the time Oracle is waiting for a work request from the application. Many practitioners of Oracle performance will not even look at these idle events because they do not consume resources and are not limiting what Oracle can do at any given point in time. Some will even go so far as to state that the idle events have no meaningful information. This is not necessarily true. Take for instance the idle event ‘SQL*Net message from client’. This idle event is not inhibiting the database server from performing work but, as many agree, is an indication of poor response from client to database server. While idle events are not the result of direct resource contention, they are an accurate measure of accumulated delays in the application imposed by Oracle.
    The ‘idle’ event “PL/SQL lock timer” is worth watching because it points us in the direction of application response, throughput, and possible coding issues. The PL/SQL lock timer event is, as the command that issues it states, a sleep mandated by the application code. The application is idle and doing nothing. This means that if the application sleeps for a combined interval of 5 minutes, the response to the user or complete run of the application will take at least 5 minutes longer.
    While this event does not require resources and thus is not an Oracle resource contention issue, it is our job to provide the quickest response to users and push applications through our system to increase the user’s perceived performance.
    Most often, sleeps are put into an application for serialization of transactional events or spinning on queues until something happens. When the event occurs or a queue is populated, then the application continues its work. We should ask ourselves why an application is sleeping for any amount of time and provide alternatives if necessary to reduce this idle event. You will gain quicker responses if you trigger an action instead of the action waiting for an event.
    How to look at the PL/SQL lock timer event
    To initiate a sleep for the current session for five seconds.
    SQL> execute sys.dbms_lock.sleep(5);
    To take a look at current sessions that are using the SLEEP command. Notice that the column P1 in V$SESSION does not represent the amount of time the session has slept but in fact represents the duration this session will sleep. Also note that this column is in centiseconds and as such the five seconds issued for a sleep has been translated in to 500 centiseconds.
    SQL> select osuser,event,p1 from v$session where event = 'PL/SQL lock timer'
    OSUSER EVENT P1
    Johnny Smith PL/SQL lock timer 500

Maybe you are looking for

  • Request.getParameter(

    I have two combo boxes. whenever a user selects some value in first combo box then using ajax code i am getting the contents of other combo box. The first combobox is department list combo box and second one is employee list combo box. The contents o

  • 3GS phone is stuck on "connect to iTunes" graphic, iTunes doesn't recognize it

    During IOS 5 upgade process, after iTunes performed backup and wipe, screen went to "connect to iTunes" graphic, however, iTunes will not recognize it.  I can't perform a restore until I can get iTunes to recognize it.  Can someone give me detailed d

  • 20" Cinema - Thrilling design but Ergonomy??!

    Although the Cinema is quite state of the art in both design and technology I'm experiencing massive problems with its ergonomical conditions. With the standard desk height of about 0,73 to 0,76m i keep looking over the top of the screen and thus nee

  • Product selection advise please.

    I have a client that has just installed a T1 line. They wish to retain DSL as backup. I'm looking for a Router with VPN capability, multiple (2) IP input, and 16 port switch. at least 4 need to be 1000 bps. Does Cisco have such a product?

  • Opening new panel with help of menu

    I want to open a new panel by clicking on menu item. eg-MenuItem is depositcash then the form regarding details to be filled during deposit cash should be opened etc and how to display dialogbox if error is generated?