Why dbms_lock.sleep (n seconds) Gets a deterministic behavior in the following code?

Hello everyone,

Parameter Value
Oracle VersionEnterprise Edition Release 11.2.0.1.0 - 64 bit
OPERATING SYSTEMLinux Fedora Core 17 (X86_64)

Consider the following code:

SET SERVEROUTPUT ON
BEGIN
     sys.dbms_output.put_line('sleeping for 3 seconds');
     sys.dbms_lock.sleep(3);
     sys.dbms_output.put_line('done.');
END;
/
SET SERVEROUTPUT OFF;

I expect the above code to make, made in order the following:

  1. Print the message "sleep for 3 seconds"
  2. Sleep switch for 3 seconds
  3. Print the message 'done '.

Yet, what is happening is that the program runs respectively then Step2 step 1 and finally Stap3. In other words the program first, sleeps, and once past the sleep period messages are printed.

Could someone explain to me why?

Thanks in advance,

Kind regards

Dariyoosh

"

Note:

Messages sent usingDBMS_OUTPUT

are not actually sent to the mailing of subroutine or complete relaxation. There is no mechanism to flush the output during execution of a procedure.

"
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_output.htm#CIHEGBBF

Tags: Database

Similar Questions

  • Why all numbers use symbol 'L' in the following code?

    Why all numbers use symbol 'L' in the following code?
    Thank you
    public static final long MILLIS_IN_YEAR = 1000L * 60L * 60L * 24L * 365L

    qkc wrote:
    Why all numbers use symbol 'L' in the following code?
    Thank you

    public static final long MILLIS_IN_YEAR = 1000L * 60L * 60L * 24L * 365L
    

    Java language rules: an L after a literal integer in Java indicates that this constant should be kept as a long (64 bit signed) instead of int (32 bits signed).

    If you have not used to that, all the numbers on the line would be treated as integers (ints) (32 bit) and multiplier with an int int translates an int even if you want to store in a long.

    Since int cannot fully represent the full product (about 31.5 billion) as it is greater than Integer.MAX_VALUE (2 billion), so if you have not used the long as operands for multiplication, you finally get an incorrect value in MILLIS_IN_YEAR because the last multiplication would cause an overrun.

    Best regards

    Robert

  • Why the following code causes a time-out when you try to read a finite number of samples of the USB-6216?

    I do not have Measurement Studio, but I use the 4 available with DAQmx .NET support.

    The following code throws a timeout when calling ReadMultiSample(). Can someone please tell me what I'm doing wrong? I would get 40 000 samples with a sampling rate of 20 kHz. I've renamed by device USB-6216 of 'Meas1' by using MAX.

    [edit] I want to emphasize that I use AnalogMultiChannelReader because I intend to grab more than one channel once I understand that.

    Thanks in advance!

                using (task task = new Task()) {}
    task. AIChannels.CreateVoltageChannel ("Meas1/ai1", "", AITerminalConfiguration.Differential, -0.2, 0.2, AIVoltageUnits.Volts);
    task. Timing.SampleQuantityMode = SampleQuantityMode.FiniteSamples;
    task. Timing.SampleClockRate = 20000;
    task. Timing.SamplesPerChannel = 40000;
    AnalogMultiChannelReader reader = new AnalogMultiChannelReader (task. Stream);
    task. Start();
    samples is reader. ReadMultiSample (40000); // <-- timeout="" occurs="" during="" this="">
    task. Stop();
    }

    I forgot to put the SampleTimingType:

    task. Timing.SampleTimingType = SampleTimingType.SampleClock;

  • HP 2000: I have a Hp laptop computer 2000 I don't know the password for the bios the error I get is the following code.

    I have a Hp laptop, 2000 but I neeed to access the bios and I do not know the password the error I get is the following code.

    85280672

    Help

    Hello

    Come in:

    30188274

  • I get in WSS 3.0 the following SharePoint error: some or all identity references cannot be translated

    I get in WSS 3.0 the following SharePoint error: some or all identity references could not be translated.

    That's when I tried co create a new site or access options in the Central Administration of Sharepoint 3.0, the administrator who created the company and his account has been removed from the pub after this left WSS 3.0 this error pops up, even though I'm an administrator of WSS 3.0, I still get this error.

    Hi Alex,

    Your question is beyond the scope of what is generally answered in this forum of consumer. I would recommend the number of professionals IT on Technet:

    http://social.technet.Microsoft.com/forums/en-us/category/SharePoint2010

  • When I try to install the 'install Creative Cloud' I get this message "we encountered the following problems: Setup failed in a critical file.» Please try to reinstall. (Error code: 43)

    When I try to install the 'install Creative Cloud' I get this message "we encountered the following problems: Setup failed in a critical file.» Please try to reinstall. (Error code: 43). I tried so many times and repeat me the same mistake. Help, please!

    Please check the resolution:

    Concerning

    Stéphane

  • I have several websites in Muse. Everything was fine until last night. When publishing to Business Catalyst I get a message, teling me the following: unknown authentication problem - shared unknown error: 80. What should do?

    I have several websites in Muse. Everything was fine until last night. When publishing to Business Catalyst I get a message, teling me the following: unknown authentication problem - shared unknown error: 80. What should do?

    Hello

    To resolve this problem, you will need to disconnect muse and connect again.

    Here are the steps to the disconnection of Muse:

    1. help > log out.

    2. Once signed on restart Muse (please sign using Adobe ID if she invites to connect)

    You should be all set.

    Concerning

    Vivek

  • Why use read. A long time to read the date type in the following code?

    Why use the read. Long to read the type of date in the following code?
    Thank you
    public void readExternal(PofReader reader)
    throws IOException
    {
    setFirstName(reader.readString(0));
    setLastName(reader.readString(1));
    setHomeAddress((Address) reader.readObject(2));
    setWorkAddress((Address) reader.readObject(3));
    setTelephoneNumbers(reader.readMap(4, null));
    setBirthDate(new Date(reader.readLong(5)));
    }
    Published by: qkc on August 25, 2009 20:15

    qkc wrote:
    Why use the read. Long to read the type of date in the following code?
    Thank you

    public void readExternal(PofReader reader)
    throws IOException
    {
    setFirstName(reader.readString(0));
    setLastName(reader.readString(1));
    setHomeAddress((Address) reader.readObject(2));
    setWorkAddress((Address) reader.readObject(3));
    setTelephoneNumbers(reader.readMap(4, null));
    setBirthDate(new Date(reader.readLong(5)));
    }
    

    Published by: qkc on August 25, 2009 20:15

    Because the Java Date instances are stored internally as long (millisecs elapsed since the beginning of the year 1970), so to represent a Java Date, more efficient storage is just to store the long number returned by getTime() and use this long to build Date.

    In addition, historically (with, for example, ExternalizableLite), there is no out-of-the-box support for attributes Date precisely, they were treated as simple objects (store lots of unnecessary data).

    Best regards

    Robert

  • I get a strange behavior of the bar tabs and the address bar in Firefox 29,0 for Mac.

    I just installed Firefox 29,0 for Mac.
    I have a strange behavior of the bar tabs and the address bar with this new version.
    Instead of the address bar, I get two rows of symbols. And it is impossible to write anything in the address bar.
    (I add a screenshot, but I can't find a way to do it).

    Firefox has an RSS icon in the palette of the toolbar that you can drag a toolbar (but not on the location bar container).

    • Firefox menu button > Options/Preferences > toolbars
    • View > toolbars > customize
  • Can I get my serial number from the Product Code?

    I can't have my serial number. I have the disc for Lightroom 5 and am on my second computer, but I bought 2 years ago and cannot access the original with the serial number inside email. Throughout the disc, I have the Product Code, which has 22 digits instead of 24. I can use it to access my serial number?

    Hello

    I suggest you to check online according to your plans and your products to display the registered for Lightroom 5 serial key:

    https://accounts.Adobe.com/plans

    Kind regards

    Claes

  • Why is it difficult to get a straight answer on the future price increases for the offer of $9.99 PS CC

    I am owner CS6 and am happy with it. I've been a user of PS since the second version, so I have a great experience with the updates and the value I'm looking for. I'm an amateur, advanced, so it is a hobby, not a source of profit and Adobe must take account of us. No one wants to buy a product that may continue to increase in price indefinetly after already have one or can find replaces it. The curret offer is more expensive than upgrading every other time (or when there is a great novelty ) like I usually do. Taking into consideration that rating current basis for new contracts for PS CC is $ 20 per month forever , it is much more expensive and climb to the summits even more unreasonable.

    Adobe should freeze the rates relating to the offer of $9.99 for 5 years (or commit to limit the increase to a nominal amount) and consider that this approach an annuity as a means of securing the existing fans and regular.  They created a lot of patient risk their move to CC without any a real advantage for clients.

    This is the reality, unless customers disagree.

    They would have not sent all the investigations, tilted the PR and even provided the lower prices for existing custmores if all of it was their choice.

    They can only try to maximize their profits, and then we have the final choice to make.

  • How to get a serial number or the redemption code?

    I've already paid for the photography Plan and download the software, but why always the trial? How to get a code redemption or serial number?

    Hi Sadydu78,

    Like its a subscription service so not necessary to any number or redemption code. I would ask you try sign and connect to office creative cloud. If its still ask the serial number then please check the links below that the same question has been discussed.

    Creative Cloud applications unexpectedly back in test mode - creative software says cloud my free trial has expired, but I have a paid subscription

    Creating cloud asking serial number - Cloud Creative applications ask for serial number

    Let me know if you need more help on this.

    Thank you
    Florianne Jindal

  • Why GetMonitorBrightness function returns false in the following code?

    I create an application in Qt (its an IDE-platform) in which I want to add the functionality of change of brightness of the screen, but when I call the function GetMonitorBrightness, it returns false, and I don't know why. Maybe my code is not good I don't know please help me solve this problem.

    And I only monitor then there is no need to call the GetNumberOFPhyscialMonitors function right?

    My Code:

    void EyeCare::on_startcaringButton_clicked()
    
    {
    
        HMONITOR monitorHandler = NULL ;
    
        LPDWORD minBrightnessLevel = NULL , maxBrightnessLevel = NULL,
    
        currentBrightnessLevel = NULL ;
    
        HWND windowHandler ;
    
        windowHandler = FindWindow(NULL,NULL) ;
    
        monitorHandler = MonitorFromWindow(windowHandler, MONITOR_DEFAULTTOPRIMARY) ;
    
        if (GetMonitorBrightness(monitorHandler,minBrightnessLevel,
    
                             currentBrightnessLevel, maxBrightnessLevel) ){
    
            DWORD newBrightnessLevel = (*maxBrightnessLevel) - 50 ;  // my current brightness is 100%
    
            SetMonitorBrightness(monitorHandler,newBrightnessLevel) ;
    
            SaveCurrentMonitorSettings(monitorHandler) ;
    
            style.append("color: green ;") ;
    
        }else
    
            style.append("color: red ;") ;
    
        ui->startcaringButton->setStyleSheet (style) ;
    
        QErrorMessage *errorMessage = new QErrorMessage ;
    
        errorMessage->showMessage(GetLastErrorStdStr());
    
    }
    
    QString GetLastErrorStdStr()
    
    {
    
      DWORD error = GetLastError();
    
      if (error)
    
      {
    
        LPTSTR errorMessage;
    
        FormatMessage(
    
                    FORMAT_MESSAGE_FROM_SYSTEM |
    
                    FORMAT_MESSAGE_IGNORE_INSERTS |
    
                    FORMAT_MESSAGE_ARGUMENT_ARRAY |
    
                    FORMAT_MESSAGE_ALLOCATE_BUFFER,NULL,
    
                    error,0,(LPWSTR) &errorMessage,0, NULL );
    
        return QString :: fromWCharArray(errorMessage) ;
    
      }
    
    }
    

    My header files:

    #include

    #include

    My library files:

     

    dxva2.dll (copied ' c:/windows/system32' folder Dll in my project folder)

    dxva2.lib (copied "c:/windows/system32" in the library of my project folder folder)

    This is how include you the Qt library:

    win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
    
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
    
    else:unix: LIBS += -L$$PWD/Library/ -ldxva2
    
    INCLUDEPATH += $$PWD/Library
    
    DEPENDPATH += $$PWD/Library
    

    Hello

    This issue is beyond the scope of this site and should be asked on the forums Technet or MSDN.

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

    Concerning

  • How can I get notifications as described in the following procedure.

    Video: https://helpx.adobe.com/creative-cloud/how-to/creative-cloud-share-files-collaborate.html

    I would like to receive a notification when my colleague publishes and updates a file in our folder "collab.

    Updates of the file, but I do not get a notification, and it does not appear on my feeding activity is.

    You can help

    Hello

    These answers help you CC help | FAQ of collaboration

  • After making a recovery from my PC I can't get updates window because of the error Code: 0 x 80240036

    Just made a full recovery from my pc there is no update at all as I can't update my pc because of the error code: 0 x 80240036.

    I am running windows xp professional

    I'm happy to have helped.

    Tricky

Maybe you are looking for

  • Windows 8 and USB external hard drives

    I want a new dv7 with Windows 8 and an Iomega Prestige 1 TB external hard drive I use successfully on Windows XP, Windows Vista and Windows 7 systems. It behaves erratically in Windows 8. Sometimes it is not recognized at all. Sometimes it is, but tr

  • HP 2000: stuck on administrator password

    I stuck on the forgotten administrator password the password when I give the password it shows disabled system 60059608

  • Display image cwimaqviewer in c#?

    I want to display a variable of the type bitmap in the cwimaqviewer of the library of the vision, how is this possible? a workaround is to copy the variable image to the Clipboard, but it isn't really proffessional anybode help me?

  • USB stick not capable for readyboost

    I have hp v210w reader pen 16 gb. I used this device to readyboost option provided by microsoft windows 7. but now it is said that this device cannot be used for readyboost, the device does not have the performance characteristics required for use in

  • Impossible to upgrade to 8.1 Windows

    I'm trying to upgrade Windows 8 to 8.1 Windows.  From the start screen, I click on "Update to Windows 8.1 free".  It appears to start, but then I get the message "Windows 8.1 - this application has not been installed - view details."  The message whe