Job queue and event ADVANCE.

Hello

I'm getting to do advanced queues work which could be removed by the use of event in function. For a single message, it seems to work but if I queue of messages more some of them are 'lost' without having been processed. In below code I create job scheduler queue and event. Then I enqueue messages 3 - two immediately after each other and third with 5 delay. Only the first and the third message are processed (and written to the TST_DATA table). In the queue table, it seems all messaged have been processed. RDBMS version is 12.1.0.2.

Thanks for any response.

CREATE TABLE TST_DATA (
  sCommand VARCHAR2(50)
);

CREATE TYPE TST_PAYLOAD_T AS OBJECT (
sCommand VARCHAR2(50)
);
/

CREATE OR REPLACE PROCEDURE processMessage(
  itMsg TST_PAYLOAD_T
) IS
BEGIN
  INSERT INTO TST_DATA (sCommand) VALUES (itMsg.sCommand);
  COMMIT;
END;
/

BEGIN
    dbms_aqadm.create_queue_table(
      queue_table => 'TST_QUEUE_TAB',
      queue_payload_type => 'TST_PAYLOAD_T',
      multiple_consumers => TRUE
    );

    dbms_aqadm.create_queue(
      queue_name => 'TST_QUEUE',
      queue_table => 'TST_QUEUE_TAB'
    );

    dbms_scheduler.create_program(
      program_name => 'TST_PROG',
      program_type => 'STORED_PROCEDURE',
      program_action => 'processMessage',
      number_of_arguments => 1,
      enabled => FALSE
    );

    dbms_scheduler.define_metadata_argument(
      program_name => 'TST_PROG',
      metadata_attribute => 'EVENT_MESSAGE',
      argument_position => 1
    );
    dbms_scheduler.enable('TST_PROG');

    dbms_scheduler.create_job(
      job_name => 'TST_JOB',
      program_name => 'TST_PROG',
      queue_spec => 'TST_QUEUE',
      enabled => FALSE
    );
    dbms_scheduler.enable('TST_JOB');

    dbms_aqadm.start_queue('TST_QUEUE');
END;
/

DECLARE
  ltMsg TST_PAYLOAD_T;
  ltEnqueueOptions dbms_aq.enqueue_options_t;
  ltMsgProperties dbms_aq.message_properties_t;
  lrMsgId RAW(16);
BEGIN
  ltEnqueueOptions.visibility := dbms_aq.IMMEDIATE;
  ltMsg := TST_PAYLOAD_T('test1');
  dbms_aq.enqueue(
    queue_name => 'TST_QUEUE',
    enqueue_options => ltEnqueueOptions,
    message_properties => ltMsgProperties,
    payload => ltMsg,
    msgid => lrMsgId
  );
  ltMsg := TST_PAYLOAD_T('test2');
  dbms_aq.enqueue(
    queue_name => 'TST_QUEUE',
    enqueue_options => ltEnqueueOptions,
    message_properties => ltMsgProperties,
    payload => ltMsg,
    msgid => lrMsgId
  );
  dbms_lock.sleep(5);
  ltMsg := TST_PAYLOAD_T('test3');
  dbms_aq.enqueue(
    queue_name => 'TST_QUEUE',
    enqueue_options => ltEnqueueOptions,
    message_properties => ltMsgProperties,
    payload => ltMsg,
    msgid => lrMsgId
  );
END;
/

SELECT * FROM TST_DATA;

Hello

you're right: after two immediate queue operations and a separate queue there are only two lines in the table

(tested on 11.2.0.4):

SQL> select * from tst_data;

SCOMMAND
--------------------------------------------------
test1
test3

If you wait just 1 sec after each DBMS_ENQUEUE there are 3 rows.

Even with a visibility using DBMS_AQ.COMMIT and COMMIT after that each line there are only 2 rows.

This mechanism using DBMS_SCHEDULER and EVENT_MESSAGE functionality seems to be a bit slow.

You must specify the option parallel instance for your business:

DBMS_SCHEDULER.set_attribute ('TST_JOB', 'parallel_instances', TRUE);

You will get then 3 rows, even without a delay of sleep:

SQL> select * from tst_data;

SCOMMAND
-----------------------------
test1
test2
test3

Kind regards

WoG

Tags: Database

Similar Questions

  • use the queue and event to read data from two series mean

    Hi all

    I'm reading the data of two serial port using QUEUE AND EVENT but not sccusess. can someone help me?

    I use LABVIEW 2011.

    att my project.

    regrads.

    You stop the second for loop using cluster of error which means that your upper and lower loop stops when you press exit but not the one in the middle. In theory, you should send a queue for loops below when you press the exit button and also make sure that you shoot hunting all queues before closing everything.

  • Queues and events

    Dear friends,

    I need a small program for the following scenario example

    I have a queue, values must be read in the queue and it must be sent through serial port

    (1) the mode of filling the queue is initially a set of string value will be filled (I can implement this part);

    (2) the user inserts a string to the queue with a click of a button, if the user click on a button for example 'A' should be in queue in the queue, so another 'B' button like that.

    (3) if the queue is empty it should be turned over a set of chain in order for example 'P', 'Q', 'R' and then if the user on the new button (say for example 'P' and 'Q' is in queue, just before R is sent, the button was clicked) it must return to the second step and finish it then return to phase III

    As part of the event generation is a bit difficult for me, could you please someone provide a basis for this application example (I use version 8.0)

    Thank you

    Best regards

    Tom

    Hello Delph,

    The easiest way to add additional, based on the separate button clicks events would be to reproduce event here that handles the click of a single button. You can follow the following steps to do this easily:

    Duplicate the occurrence:

    Choose the new control created in the duplication and the value change event:

    Move the new control on front panel and rename the label and/or Boolean text:

    As far as sending a set of commands of initialization (which is what it looks like you do), you can simply add a loop after the queue is obtained, but before you enter the loop of the producer. By indexing the loop by a predefined set of channels, you can enter the commands of initialization before entering the loop of the producer. This gives you your commands to initialize before allowing user input.

  • HP Envy 4500: Print jobs disappear from the print queue and not print (Windows 7).

    I just bought a HP Envy 4500 printer,

    When you attempt to print from a PC with windows 7 OS home pro (64-bit), the print job appears in the queue and then disappears, but the printer does not print anything.

    Everything else seems to work very well know

    • The printer prints the internal test page
    • The printer does print when you use iPad2
    • The printer does print when you use ePrint
    • The PC recognizes and communicates with the printer (tried with USB connections and wireless)
    • Analysis feature works very well - when initiated from the PC and printer

    I tried

    • uninstalling and reinstalling the software (several times using software from different sources)
    • restart the printer queue service
    • Disabling the firewall
    • running printing HP and doctor Scan
    • following the instructions described here (the question is the same but the different operating system):

    Print jobs disappear from the print queue and print (Windows 8)

    • combinations of all of the above

    Absolutely no joy in any of them, and in spite of more than 2 hours of research on Google and forums search I can't find a solution.

    HP... can you give me a solution or is that goes back to the shop?

    Well I finally worked on the fix myself by trial and error.  I changed the security settings for 'All' and 'Creator owner' to 'Print' and "Administer Documents".  Why on earth they were not automatically allowed as part of the installation, I couldn't really say.

    Hope this helps someone else with a similar problem.

  • Print job is stuck in the print queue and cannot be removed in HP OfficeJet J4680

    Original title: HP OfficeJet J4680

    Print job is stuck in the queue and cannot be deleted.  Convenience store said it is fixed, but it isn't.

    Hello

    I imagine the inconvenience that you are experiencing. I will certainly help the question of fixing.

    To help you suggest several steps to solve the problem, I would appreciate if you could answer the following questions:

    1. what operating system is installed on your computer?

    2. have you made any recent hardware or exchange of software on your computer before the show?

    3. you receive an error code or message?

    4. what store did you try?

    What version of the operating system Windows am I running? :

    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

     

    Please follow the steps in the link below and check the issue.

    Unable to print? Print jobs are stuck in the print queue:

    http://h10025.www1.HP.com/ewfrf/wc/document?DocName=c02205477&tmp_task=solveCategory&cc=us&DLC=en&lang=en&LC=en&product=3692888

    For reference:

     

    Solve printer problems:

    http://Windows.Microsoft.com/en-us/Windows/printer-problems-in-Windows-help#fix-printer-problems=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

     

    Diagnose and automatically fix problems printing and printer:

    http://support.Microsoft.com/mats/printing_problems/

     

    I hope that the information above helps you.

  • Printer is printingjob in the queue and new jobs keeps printing how to remove all the tasks in the queue? Have a lot of

    Have a lot of jobs in the queue and would like to erase everything and start a new.

    I don't see why you have posted in the forum Feedback, so I moved your post to the windows 'Hardware and drivers' forum.  Please return to your message, click Edit located just below, change the drop-down list of the Windows Version for your version of Windows, then click on submit.

    Click Start > settings > printers and faxes or start > devices and printers.  Double-click your printer.  Depending on your Windows version, you will also need to double-click now 'See what's printing', click Printer > cancel all Documents

  • Printer does not print after canceling a print job even if I deleted the queue and stop the printer and the computer.

    Re Vista - printer does not print after canceling a print job even if I deleted the queue and stop the computer and the printer and restarted.

    Hello

    ·                         try to uninstall and reinstall and use the latest printer drivers VISTA for your model of the manufacturer of the printer

    You can also track information to try to solve your problems of printer below

    read the printer correct that information the slot microsoft, including the 'fix - it' and the information of the links to the other

    Solve printer problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-printer-problems

    and read this microsoft tutorial too

    Introduction

    This tutorial is designed to help you identify and fix the problem printer common windows problems, including print errors, or errors, and other issues that could prevent you from printing. This tutorial does not cover printing problems related to specific programs. Printing problems can be caused by cables that are not properly connected, corrupt, drivers, incompatible drivers, the printer settings, missing updates and problems with your printer.

    How to use this tutorial

    For best results, complete each step before move you on to the next. Try to print after each step before moving on to the next step.

    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

  • Application.invokeLater () and event queue size limit

    Analysis of Application.invokeLater () is insufficient. He mentions a "size limit" of the queue of the event but never defines it or said if it is always applied. Therefore, the contract is ambiguous.

    I would really like to know:

    1. am I guaranteed that an executable that I turn to Application.invokeLater () will eventually race, if the event thread doesn't die?

    2. What is the size limit of the event queue and it's always enfoced or only when the event thread did not intervene?

    3 - How is applied the limit? Runnables get just dropped from the back of the queue and nothing happens?

    I tried.

    The platform throws an exception and judge of the application to be unresponsive not once you have planned a not-very-large number of runnables.

    It is a pity that this is not documented and it is a pity that the queue is so short. Now I have to have a queue in my code to avoid this situation.

  • Photosmart 5520-printing from browser job queued sticks

    Running Windows 7 32 bit home edition and I am trying to print 9 Explorered Internet consistatnly.

    Since the purchase and installation of the 5520 printer, I've been running the questions where the jobs are in a print status in the queue but nothing comes out of the printer.  The printer is configured to print from WiFi and happens on all 3 of my computers.  I need to remove the task from the queue and then stop and restart the spooler before work service removes it from the queue.  I can print from Word, Excel and other applications, but when printing from the browser it happens at least once a day.  I would say that if a website has a button "print" the problem does not occur, but when you select just print in the menu of the browser, it happens more often.

    It becomes very annoying and would like this to be resolved.  This never happened with my Canon Pixma printer that has replaced this printer.  I ran the HP printer diagostics and there no question.

    The problem is caused by a conflict pilot between IE 9 and the print driver. The solution is to uninstall IE 9 and use IE 8. Normally, this solves the problem. If this isn't something you want to do, there are other options. First of all, you can try using another web browser. I'll include links to Firefox and Chrome downloads. Another of the options, is that you can try to use a different printer driver. I would add as well the instructions below. Hope that helps.

    Firefox:
    http://goo.GL/7ICv2

    Chrome:
    http://goo.GL/MAqrN

    To use a different print driver for printers HP with Windows 7:
    1. click on the start menu.
    2 click devices and printers.
    3. right click on your printer.
    4. Select printer properties.
    5. click on the Advanced tab.
    6. click on new driver.
    7. click on next.
    8. Select HP in the first list.
    9. Select Deskjet 450 in the second.
    10. click Next.
    11. click on finish.
    12. click on apply.
    13. click OK to close the window.

  • Cannot print with hp psc 1300------tried to delete print queue and it showed that the "deletion" for more than 24 hours

    my daughter tried to print out a list and it printed a page, then sprayed upward. We tried of the deletes the remaining queue, and the State showed 'delete '. It is on this status since yesterday, I can't print.

    I rebooted and off voltage & power of taking off. I don't know what else to do. Help :-(

    Thank you

    Hello

    The operating system that you are running on your machine?

    Follow the steps in the article below and check if it solves the problem:

    Print jobs are stuck in the print queue and Will not print using a USB connected product
    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?objectID=c00843712&lang=en&cc=us&TaskID=135&ContentType=SupportFAQ&prodSeriesId=306884&prodTypeId=18972

  • HP LaserJet Pro CM1415: Printer will only print a single document. Bloggy queue and I need to restart the computer to print

    Printer will only print a single document. Bloggy queue and I have to restart my computer to print more than a single and repeat for each print job... very annoying. She's been doing this for printing the PDF, chrome, Word document, etc.

    Hello.

    Please, try the suggestions you find here:

    http://support.HP.com/us-en/document/c022054777

    Dovid

  • When to recreate queues and tables of the queue in QA?

    When recreate us queues and queue tables when you use Advanced Queuing? Is there an advantage in doing this?

    dbms_aqadm.stop_queue)
    dbms_aqadm.drop_queue)
    dbms_aqadm.drop_queue_table)

    dbms_aqadm.create_queue_table)
    dbms_aqadm.create_queue)
    dbms_aqadm.start_queue)

    Also, can you please let me know what is the difference between the queue and queue table? I'm newbie and not able to get help on that. I had a little of that first we can create the queue table and then create the queue. Any help would be appreciated.

    Why do you want to "recreate" the queues and queue tables?

    Read the documentation of

    DBMS_AQADM.ALTER_QUEUE
    and
    DBMS_AQADM.ALTER_QUEUE_TABLE
    

    and see if you can get out without falling and re - create

    In the contrary case; do some reading on how to manage queues, to drop, modification and creation!

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14257/aq_admin.htm#i1005956
    and
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14257/aq_admin.htm#i1006297

    If you want to change the payload type, you need to remove the queue and re-create it, in which case read on drop, keep in mind the STOP_QUEUE!
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14257/aq_admin.htm#i1006355

    Similarly for the DROP table queue!

    P;

  • point check queue and LRU list

    Mr President

    I do IE 9i WDP basic-1. OCA 9i.
    I do not get a clear view of the checkpoint queue and LRU list.t.My question is how LRU list and control point that work together?

    for this topic, I got to know (if I'm wrong please correct me) that the LRU list entry is made when a block is updated first. And when the block is updated and updates more he'll mainly used end of the LRU list. and the first gt update block placed in queue.check - point control queued point basically stores RBA(redo_bite_address).and its going to log.is all this interaction with the LRU and checkpoint queue? If so how RBA is generated?


    concerning

    I don't want to do a nit pick, but what you mentioned is not going to go to different locations.

    Satishbabu Gunukula wrote:
    LogSwitch forces a checkpoint, which updates the database disk files.

    Hereby, you should mention that this point of control switch journal actually emits a Checkoint of wire that can be different in a CCR environment and is surely different from a Global checkpoint.

    >
    Specifically, a control point copies the memory to the database server cache pages to the database hard disk file. The server made the copy in a coherent way; in other words, it copies only the results of committed transactions. The result is that all the data in the database file is data validated to run transactions. If the server goes down between the control points, the player will have a coherent and valid (although not necessarily up-to-date) snapshot of the data.
    >

    Completely wrong!

    Control points does not write everything on its own. To be precise, written to happen because of the recovery are trying to be optimized by oracle in these last two versions. Process Checkpoint fires just the DBWR to "check and write" If there is something to do. It is not copy anything to the memory for the data files and certainly committed or uncommitted data have nothing to do with the control points. If a buffer is dirty and we need to offer a space or control point event is the triggering of the buffer to get out for a list of writing, it is emptied anyway, regardless of who its committed or not. Your last line makes no sense to me where you said, "If the server goes down between the control points, the player will have a coherent and valid (although not necessarily up-to-date) snapshot of the data.'." What would happen in an instance crash would be the recovery instance.

    Between control points, the server writes transactions posted to a transaction log. If the server goes down, all transactions committed since the last control point can be recovered from the transaction log. After a crash of the system, the database will start to recovery of the transactions since the last checkpoint.

    Thank you to read what I said just above, recovery has nothing to do with the State of validation of the buffers.

    HTH
    Aman...

  • After you restore an image of my system drive, my tasks and events disappeared. Help!

    I've restored a backup image on my C: drive. Everything looks good except all my events and tasks have disappeared from the calendar!
    I understand that this data is included in my profile, but how do I get my events and tasks and put back them in the calendar? Are the import and export of functions expected to be used to provide backups of my events and tasks? Shouldn't they already appear in the calendar after the restoration of a system disk?

    After a lot of messing around, I think I solved this problem.

    The problem occurs because of an incompatibility between certain values in prefs.js vs values in the data table cal_events.

    I copied backup prefs.js (containing the 'calendar') related lines in the current prefs.js and now everything looks OK, I can see my tasks and events in the calendar.

    The lines looked like this:
    user_pref ("calendar.list.sortOrder", "75f0f98f-9fdf-4bca-9e48-656ff2e1457d 012fd0d9-bcf1-43b1-a98d-6b0117a3f779 511ca361-a646-4f94-880b-526a0a5cdba1");

    These long numbers must correspond to the values of the column. cal_id apparently if they do not match, they do not appear in the calendar.

    Mine does not, so I corrected the values in the prefs.js file and everything seems to go fine now.

    I still need to find the cause of the incompatibility, I think it was something in the way that I restored the disk then run MozBackup to restore my backup Thunderbird.

    Hope this helps others with this problem.

    Many thanks to Gnospen and Matt for their help!

  • The Shutdown() call causes a StartExecution and event EndExecution

    When my application ends, he calls the following my recall of closing the form code:

    If (this.axApplicationMgr.Shutdown () is false)

    {

    e.Cancel = true;

    }

    on the other

    {

    ...

    }

    But before the ExitApplication event occurs, a StartExecution and event EndExecution occur.  Whence these extrinsic events and how can I get rid of them?

    It's normal.

Maybe you are looking for