AQ Locking Using Correlation ID

I need to pull multiple messages from a queue, grouped around a certain non static key.
I am using a correlation id to achieve this and it all seems to work fine except that the messages retirved via the corrid are not locked exlusively to the calling application whilst being dequeued.
As I have multiple applications all polling the queue it is possible for two applications to request the same "set" of messages at the same time, i.e. have the same corrid. However it appears that AQ does not do an equivalent to "select for update" when getting items via a correlation id.
I am using a dequeue_mode := dbms_aq.LOCKED, which I would expect to lock all messages that matched a particular corrid.
Is this not the case?
I can do a select for update no wait on the messages first and handle the -54, but wanted AQ to handle this itself, is there a way to do this or should I work around. Would obtaining a row lock on an AQ table cause any problems?
cheers

LOL @ getting shot down by the Mod in trying to figure out your error. Sorry. I don't mean to be rude it's just i'm in the same boat, but no way of figuring out why my template would save. Hours of work wasted.

Similar Messages

  • Top n Analysis using correlated subquery

    Please explain this query. It is doing top n analysis using correlated subquery. I need explaination of execution of this query.
    Select distinct a.sal
    From emp a
    where 1=(select count ( distinct b.sal) from emp b
         where a.sal <=b.sal)
    Thanks in advance

    Try breaking the query down and rewriting it in order to follow the logic;
    SQL> --
    SQL> -- Start by getting each salary from emp along with a count of all salaries in emp
    SQL> --
    SQL> select   a.sal,
            (select count (distinct b.sal) from scott.emp b ) count_sal
    from scott.emp a
    order by 1 desc
           SAL  COUNT_SAL
          5000         12
          3000         12
          3000         12
          2975         12
          2850         12
          2450         12
          1600         12
          1500         12
          1300         12
          1250         12
          1250         12
          1100         12
           950         12
           800         12
    14 rows selected.
    SQL> --
    SQL> --Add a condition to the count for only salaries below or equal to the current salarySQL> --
    SQL> select   a.sal,
            (select count (distinct b.sal) from scott.emp b where a.sal <=b.sal) rank_sal
    from scott.emp a
    order by 1 desc
           SAL   RANK_SAL
          5000          1
          3000          2
          3000          2
          2975          3
          2850          4
          2450          5
          1600          6
          1500          7
          1300          8
          1250          9
          1250          9
          1100         10
           950         11
           800         12
    14 rows selected.
    SQL> --
    SQL> -- Add a condition to only pick the nth highest salary
    SQL> --
    SQL> select    a.sal,
             (select count (distinct b.sal) from scott.emp b where a.sal <=b.sal) rank_sal
    from scott.emp a
    where (select count (distinct b.sal) from scott.emp b where a.sal <=b.sal) = 4
           SAL   RANK_SAL
          2850          4
    1 row selected.Hope this helps.

  • Is there any known issue about mutex lock used in JNI on Solaris 10?

    Dear Oracle,
    I'm facing a strange behavior when running a JNI application that use the mutex lock. The application hanged after running for a while on one of our Solaris 10 machines. After investigating the stack trace of the application, it shows that one of all the application's threads that access the JNI hold the mutex lock forever, and that cause the other threads cannot access the JNI. The same application works fine on other Solaris 10 machines.
    The mutex function I used as show below:
    mutex_lock(&mutex)
    The application hanged at this line:
    0xff2cc940 ___lwp_mutex_timedlock + 0x8
    The Kernel version is SunOS 5.10 Generic_142900-14
    Since this issue occurrs on only one Solaris 10 machine in our environment, we are wondering if there is any known issue regarding the mutex lock used in JNI on Solaris 10. We tried to search the Internet and the Java Bug database but found nothing related to this issue.
    Best regards,
    Krit K.

    876587 wrote:
    ... and that cause the other threads cannot access the JNI. The same application works fine on other Solaris 10 machines.
    Different environments mean just that. So something could be causing it outside java.
    Additionally if anything at all is different in the execution data, such as even a name having a different size, then it would change the execution path.
    Which would cause a problem in the JNI code to manifest itself on only one box. Probably isn't a pointer bug but all sorts of odd behavior can result from that.

  • Correlation Problem: unable to Use Correlation and Activate correlation

    Hello,
    i have created correlation name in correlation list and assigned involved messages and assigned proper field in correlaton in properties .i am able to view my correlation name in the properties of both receive steps ,but when i assign it to use correlation and move cursor to activate correlation .value in use correlation is not holding the value and holding space ,the same is happening to activate correlation field.
    I am using PI 7.1.
    Please let me know if you have really overcome this issue.
    Regards,
    Vishal K
    Edited by: vishal kharat on Aug 3, 2011 6:15 PM

    it seems there is no way.
    See note 1797073
    Is there someone with a better solution?

  • Papi WS Notifcation using Correlation

    Hi,
    is there any way to notify a process instance via Papi WS using correlations in just one call? I saw that there is an operation for sending a notification, but it seems to accept only the instance id. Of course, I can make beforehand a call to getInstanceByCorrelation to find out the instance id and then pass it to the notification operation, but is there a kind of combined operation to do that?
    Thanks a lot and regards
    Matthias

    Hello,
    I have the same problem. My process has a Notification Wait exposed as a Web Service, but into the WSDL the method I would use to notify the process is described like this:
    <xsd:element name="notify">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element type="xsd:string" name="sessionId"/>
    <xsd:element type="xsd:string" name="instanceId"/>
    <xsd:element type="xsd:long" name="codeArg"/>
    <xsd:element type="xsd:string" name="valueArg"/>
    <xsd:element type="xsd:boolean" name="esitoArg"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    codeArg and valueArg are the arguments I used to create a Correlation with the process instance
    esitoArg is an argument that my process would get from an external caller
    I know that I can get the sessionId using the startSession method
    but, considering that I'm using correlation, why does ALBPM ask for the instanceId ???
    Any help will be much appreciated.

  • Using correlation with asynch RFC - Please Help!

    Hi !
    We have this scenario:
    1) receive asynch messageA
    2) transform messageA to messageB
    3) send ASYNCH RFC messageB
    4) receive RFC messageC
    5) switch condition based on messageC
    5-ok branch) send messageA
    5-err branch) throw exception
    We have only 3 containers, they are all abstract interfaces: messageA, messageB and messageC.
    We need to correlate steps 3) and 4), to match the returning messageC with the corresponding sent messageB.
    Is it ok to complete "Activate Correlation" in Send step 3) and only "Use Correlation" in Receive step 4), both with the same "name" ??
    how do we correlate different message types? (messageB <> messageC) do we need to use a container to correlate?
    Thanks !
    Matias

    Matias,
    You are right..u need to activate correlation step 3 and use it in step 4.
    Correlation between diff msg types happens this way..
    when you define a correlation...u've to defien the fields of the correlation, and the participating msg interfaces and how each msg interface populates/reads the correlation fields
    eg.
    Correlation Name: MatchPO
    Definition:
    PO_Number XSD simple Type xsd:string
    Participating Interfaces:
    MI_Purchase_Order
    MI_Sales_Order
    PO_Number = MI_Purchase_Order/Header/PONUM
    PO_Number = MI_Sales_Order/Header/Sales/PONR
    to define the correlation...u need to switch to correlation editor from process view in Integration Process editor
    hope it is clear now..
    praveen

  • Record Locking using EJB

    Hi,
    Can anyone please explain me how to achieve Oracle Row level record locking using Enterprise Java Bean ?
    Thanks for the time.
    L G Goundalkar

    It depends upon your container and your container-specific deployment settings. In Weblogic, you can specify database-based pessimistic locking which causes the CMP entity to hold a row-lock on load() until it is comitted or rolled back.

  • Cross System Lock using for roles?

    Hi everybody,
    maybe one of you can support me or have some experiences in case of using the Cross System Lock. We are checking the possibilty to implement the Cross System Lock (using in ChaRM, Scenario E (/TMWFLOW/Config_Lock).
    First of all, we made a successful test in usage of table content.
    Example:
    You save a table modification in a Transport Request generated in ChaRM. Thus, the Transport Request is buffered in a Change Document. The result is that the table modification is locked in the object-monitor (/TMWFLOW/LOCKMON).
    However, you save a role (pfcg) in a Transport Request generated in ChaRM the included objects in this role are not buffered in the object-monitor (/TMWFLOW/LOCKMON)
    Thanks for your answers!
    Best regards
    Joachim Eichner

    If you use the report TMW_TRKORR_LOCK_UPDATE against the role transport after saving your changes in it, this will register the role objects in the CSOL.
    The Role transport tool does not automatically trigger the FM that registers the objects in the CSOL, just like manually adding objects to a transport doesn't trigger it. Therefore the workaround is to run this report. Only the transport owner is allowed to run TMW_TRKORR_LOCK_UPDATE.
    In our experience it is not that CSOL does not support roles and authorizations; for the purpose of retrofit, it is able to detect conflicts reliably if the report is run consistently after saving role changes to transport. If no conflicts exists, auto-import works fine. If conflicts exist, then roles must be manually retrofitted.

  • Folder Locking using java

    Hi All,
    I want to implement the folder locking using java.But i can't find any method to implement my requirement. I find one method to lock a file using FileChannelObject.tryLock() or FileChannelObject.lock() methods of FileLock class. But the main problem is that FileChannel object is coming through only by calling getChannel() method on a RandomAccessFile object or FileInputStream object only.
    If i want to lock a folder i am not able to create the lock on it. So please provide me any example to create a lock on  a directory.
    Thanks in advance.

    JNI isn't magic. It can only call the operating system. The question is, is there really an operating system API that would let you do it.?

  • Database locking using JSP and Oracle database

    Dear All
    I am reading about how to do database locking in general and i want to implement these mechanisms using JSP pages and oracle database, but i have the following questions:-
    1.If i write a “select for update” quesry in the JSP page will it locks the record ? or it will not lock the record because the connection between the JSP pages and the server will be stateless in most online systems?
    2.If i write all my jave code in transaction , something like this:-
    • Begin transaction
    • Commit or
    • Rollback
    Then should i be worried about the locking issues or the database manger will handle the locking mechanisms to insure data integrity(and what the default mechanism (if any) that the oracle database manger use to do the locking)?
    3. If the answer for question 2 is no, then how can i handle the optimistic and the pentemistic locking using JSP pages?
    BR

    One way to solve this issue is as follows:
    * You add a new column to each database table called 'version' which is of int type.
    * Each time you alter any field in a record, you increament the version number.
    * When you read a record and display it, you store the version number in your code
    * when you go to update the record, you write your sql something like this:
    update person set firstName=? where personId=? and version=?
    Where the version is whatever you stored locally. If someone altered the record in the database while your
    end user was looking at it, the version numbers will not match and the sql statement will
    return zero as the number of records it altered. If its zero, inform the end user someone altered the record
    while he was looking at it and weather or not he wants to proceed.
    The chances of two people altering the same record in a table while both are logged in and viewing the same set of data is small so such collisions will be few.
    You only need transactions if you are updating more than one record at a time (in the same table or multiple tables).
    You dont need it for reading records if you use a single sql statement to read (for example: to join multiple tables).
    In general, you get a (pooled) connection, use it, and close it as quickly as possible in a try/catch/finally block. You dont hold onto it for the duration of the user's session. A book on JDBC should help clarify this.

  • Using Correlation in Initiator Task

    Hi All,
    I have a Manual BPM Process. At anypoint and time, to gain access to existing instance I'm using Event Sub-Process inside the same BPM Process.
    To hook up with the right instance I'm using Correlation in Event Sub-Process. It's start node activity uses the correlation property.
    Now the problem is, where do I initiate the correlation property, since the process is kicked of by the initiator. If I initiate correlation in the Human Task I'm receiving Correlation Violation Exception.
    Please share your thoughts.
    Two Cents,
    Karthick

    Hi,
    I had faced the same problem earlier also. The solution is very simple. You have to create another correlation with same properties  as the first one but with a different name. Now you will definitely be able to select the correlation.Select any one of the 2 correlations as they are doing the same tasks.
    Hope it helps you buddy!!!!
    Thanks
    Biswajit

  • Using correlation names :new and :old in ODBC

    Does anyone know how to use correlation names :new and :old through an ODBC connection?
    EG:
    CREATE TRIGGER Print_Cust_changes
    BEFORE INSERT ON CUST_tab
    FOR EACH ROW
    BEGIN
    dbms_output.put('Adding: ' || :new.custid);
    END;
    When I try to do that using ODBC, I get this error:
    Server Msg: 24344, State: HY000, [Oracle][ODBC][Ora]
    Trigger, procedure or function created with PL/SQL compilation error(s).
    And if I try and Insert I get:
    Server Msg: 4098, State: HY000, [Oracle][ODBC][Ora]
    ORA-04098: trigger 'BCL.PRINT_CUST_CHANGES' is invalid and failed re-validation
    The same code works perfectly in SQL*Plus.

    The plot thickens...
    I just tried this code:
    CREATE OR REPLACE TRIGGER Print_Cust_changes
    BEFORE INSERT ON CUST_tab
    FOR EACH ROW
    BEGIN
    INSERT INTO CUST_LOG VALUES('X');
    END;
    And received the same error:
    Server Msg: 24344, State: HY000, [Oracle][ODBC][Ora]
    Trigger, procedure or function created with PL/SQL compilation error(s).
    Again, using the same code (Cut & Paste) in SQL*Plus, it works without any problems.
    The ODBC function being used is: SQLExecuteDirect(), ODBC driver is SQLORA32.dll v9.02.00.00
    CREATE TABLE, VIEW, INDEX etc, all work fine, but not a trigger. If I read the code back from ALL_TRIGGERS after using SQL*Plus or the console application to create the trigger, it is exactly the same code...

  • Recieve Step -Use Correlation and Activate Correlation

    Hi,
    In Integration process-recieve step , Can any one Please explain what does the properties USE CORRELATION and ACTIVATE CORRELATION mean and where these should be defined?
    Many Thanks,
    Sharath

    These are if you are going to be receiving many message into the same IP.
    By default an IP is created everytime a new message is received. If you don't want this to be the case you can specify a correlation which says that if message A contains 123 and if message B contains 123 in a sepcific field then they belong in the same IP.
    you define these where you define your containers you just have to toggle between the two modes.

  • Is it possible to implement an IMEI lock using USAT / STK  on a SIM card ?

    Hi,
    Does anyone know if it's possible to implement an IMEI lock using USAT/STK and Javacard? What I want to do is write an applet that checks if a SIM has been placed in a phone whose IMEI does not match one on record, and then stops the SIM from working in the new phone if the IMEIs don't match.
    Checking the IMEI is straightforward but I'm looking for suggestions of how to stop the SIM from working in the new phone, or keeping the SIM off the network so that it cannot be used. Can this be done using USAT and Javacard or does this have to be done at the card OS level?
    Thanks,
    C.

    Hi,
    I've been involved in a similar proyect too.
    If you want to do lock the SIM editing those files contect, you should check out the READ_UPDATE Conditions ( problably, as those are very sensitive data the conditions defined are NEVER. If you are defining a complete card pesonalization, you can change it to ADM... and then you will be able to modify the values.
    for further information you can contact me by email...

  • Can we put time on receive activity using correlation sets ?

    I am using correlation sets for po process using ponumber.
    In our process we send po message out and then wait(receive) for the response.
    The receive activity will go into dehydration while waiting
    for the response with the ponumber.
    Is there any way to put a time on this receive activity so that we
    can continue with the flow after certain time.
    I was able to terminate the whole process by putting alarm
    around the receive, but I want the process to just stop the
    receive activity and continue with rest of the process.

    Hi,
    By substituting receive with pick/onMessage/onAlarm, you should be able to implement the behavior you are looking for.
    -Edwin

Maybe you are looking for

  • Storing of log file in A/P Server while running BDC session in SM35

    Hi All, I have issue when running BDC session in SM35. The actual issue is I need to store of log file generated while running BDC session in <b>SM35</b> in <b>Application/Presentation</b> Server path. When ever we run single session the Log file reg

  • Load balancing on RMI Server Application

    Hi there, I'd like to know more detail about load balancing on RMI server application, been digging the web for some time, but couldn't find much information, does anyone know any website or has the knowledge of load balancing on RMI to share? Sort l

  • Wrong Excise Duty amount in MIRO

    Hi Gurus, I have done MIGO , in which I have captured Excise Duties as BED - 35000.00, 2%ECS- 700.00, 1%S&H Cess - 350.00, but in MIRO it is showing as BED - 35000.00, 2%ECS- 35000.00, 1%S&H Cess - 350.00. My client is using TAXINJ, we have recently

  • APEX_ITEM.DATE_POPUP  and ORA-01830: date format picture ends before conver

    Hi, I am using apex_item.date_popup for a custom tabular form. When I load the form with the default sysdate it works ok. However when the user submits an invalid date I get: ORA-01830: date format picture ends before converting entire input string.

  • Retirement Date Calculation based on Date Of Birth

    Hi All, We have 11.1.2.2 PSPB Application where we have requirement to calculate "Retirement date" (in the format dd/mm/yyyy) based on employee's "Date Of Birth", for which i tried with @DateRoll function, but no luck. For time being we tried "Retire