Could not reserve record (2). Keep trying ?.... - More Details required

Hi all,
I would like to display the User who has locked the record.
Is there any possibility to implement that?
Thanks.

create DB function:
CREATE OR REPLACE FUNCTION record_locked_by (
   p_table    VARCHAR2,
   p_rowid    ROWID
   RETURN VARCHAR2
IS
   v_locker        VARCHAR2 (100);
   resource_busy   EXCEPTION;
   PRAGMA EXCEPTION_INIT (resource_busy, -54);
BEGIN
   EXECUTE IMMEDIATE    'select 1 from '|| p_table|| ' where rowid = :r for update nowait'
               USING p_rowid;
   RETURN NULL;
EXCEPTION
   WHEN resource_busy
   THEN
      SELECT se.username INTO v_locker
        FROM gv$lock lk, dba_objects ob, gv$session se
       WHERE lk.SID = se.SID
         AND lk.id1 = ob.object_id
         AND object_name = UPPER (p_table)
         AND lk.inst_id = se.inst_id
         AND audsid <> USERENV('SESSIONID');
      RETURN v_locker;
END;Now in ON-LOCK trigger you can use this code (generic)
DECLARE
   v_locker   VARCHAR2 (100);
BEGIN
   v_locker :=record_locked_by (GET_BLOCK_PROPERTY (:SYSTEM.trigger_block,query_data_source_name),
                                NAME_IN (:SYSTEM.trigger_block || '.rowid'));
   IF v_locker IS NOT NULL
   THEN
      MESSAGE (   'Record is being updated by '|| v_locker|| '. Please try again later');
      RAISE form_trigger_failure;
   ELSE
    lock_record;
   END IF;
END;

Similar Messages

  • 'could not reserve record (2tries). keeping trying?'

    Dear All,
    i have prepared a new chart of account and
    when i am defining the qualifiers of segments then system generates this error 'could not reserve record (2tries). keeping trying?'
    please help
    Asad

    Pl post details of OS, EBS and database versions.
    This message is typically displayed when you are trying to update a row in the database that is locked by another session. Your DBA can determine who has locked this row. The other session will either have to release this row or the session needs to be terminated.
    HTH
    Srini

  • Could not reserve record (2 tries). keep trying ?

    I have a post-query trigger in which I modify the value of some based fields if they are null :
    if :my_block.item1 is null then
    :my_block.item1 := :my_block.item2;
    end if;
    The probelem : when 2 users are querying the same record, we have the error : could not reserve record (2 tries). keep trying ?
    We need that more than one user can query the same record (but of course not modifying it).
    Any help ?
    Thanks.

    I believe you want to set the locking mode property of the block to delayed, as long as the side effects are acceptable.
    As soon as the first person selects, and your post-query trigger fires setting item1 = to item2, a lock is placed since that is the default mode when data is changed.
    From 10g's online help:
    For most applications use the default setting of Automatic. The Immediate setting remains for compatibility with existing applications, but there is no reason to use it in new applications. Use Automatic instead. The Delayed setting is useful for applications that must minimize the number of locks or the amount of time that rows remain locked. Use delayed locking if the form's Isolation Mode property has the value Serializable. The main drawbacks of delayed locking are The changes an end user makes to a block may need to be redone at commit time. Another user's lock can force the first end user to choose between waiting indefinitely or abandoning the changes.
    Gary

  • "Could not reserve record (2 tries) Keep trying?" vs waiting

    We received our Forms 10g applications from a vendor, & are now taking over maintenance. We're coming across 2 possible scenarios when user A has a particular record locked. User B sees either:
    - a pop-up message which reads "Could not reserve record (2 tries) Keep trying?"
    - an hourglass until user B performs a commit or rollback
    Is there a property setting on the data block or something, which causes the first scenario to execute a "select * from table where PK = <> for update nowait" or something? We can't figure out how this is happening.
    Thanks,
    Chuck

    I didn't quite understood you question. Do you want to execute a select for update when a lock is obtained?? Do you want to avoid this message???
    If you want to execute a code, you can do it by tracking the database lock error, which is ORA-00054, you can use the ON-ERROR trigger and check the DBMS_ERROR_CODE and accordingly execute your own code.
    This is a general idea, you have to be more specific so we can help you in more details.
    If you want to avoid it, you can set the Block's "Locking Mode" to "Delayed", this will allow the second user to edit the record even if the first user has locked it but on commit will prompt to re-query the data since it has been changed.
    Tony

  • Error Mesage is "Could not reserve record (2 tries) keep trying ?

    sir,
    when i running my form i m reciving this error message Error Mesage is "Could not reserve record (2 tries) keep trying ? " This is due to multi user Login, How can i avoaid from this error message.

    when you begin changing queried values, forms locks the record for other users by default. so this message appears if another user tries to change (lock) the same record. you have to wait until the locked record is commited or rolled back.

  • How can I trap the question 'Could not reserve record (2 tries). Keep tryin

    How can I trap the question 'Could not reserve record (2 tries). Keep trying ?'
    How can I trap the question 'Could not reserve record (2 tries). Keep trying ?'
    I want to know the error_code for this question before the 40501 error code.
    Thanks for the help.

    See
    Could not reserve record (2). Keep trying ?....

  • Could not reserve record(n tries). Keep trying?

    Hi all,
    I am not getting the message "Could not reserve record(n tries). Keep trying?" when i have modified the same record in another session from the same form.
    What could be the problem?? any ideas?? will be greatly appreciated.
    ThankYou
    PVKiran

    what is your lock statement?
    LOCK TABLE XXX IN ROW SHARE MODE
    or
    SELECT ...FOR UPDATE will not issue any error message even if someone is holding the lock on the same record you are attempting to update.
    use NOWAIT will force the error out.

  • CAUTION MESSAGE on form: 'Could not reserve record [2 tries]. Keep trying?

    While entering the details on Assignment form, the screen froze and eventually it stopped responding due to which I had to close the application.
    Now I am not able to key in any info. I keep getting a CAUTION dialogue box with message *'Could not reserve record [2 tries]. Keep trying?'*

    The error suggests, the same record is being used by other users. If possible, bounce the database to release locks on the table. If not possible, you need to find the session that locked the table. And kill the session to release the lock.

  • Help:could not reserve record(2 tries) keep trying

    hi friends
    what is this message and when it occures?
    message: could not reserve record(2 tries) keep trying.
    thanks in advance.
    shoja

    That is just because the previous session of the form is still locking the records,
    solution ,
    close the previous form and try again
    or
    its also because the transaction has got aborted (ie, by pressing control alt delete in the front end) and active process still exsists in the backend , identify the process and kill it. Then open the form
    regards
    Rajesh
    hi friends
    what is this message and when it occures?
    message: could not reserve record(2 tries) keep trying.
    thanks in advance.
    shoja

  • Could not reserve record(4 tries)

    Hello , I faced the following message being displayed from our application for last 4 days. I could not able to
    solve it. This is from an medical application working well for last 5 years. error is or warning is
    'COULD NOT RESERVE RECORD(4 TRIES) . kEEP TRYING?. It sounds like LOCKING . But how can i find the session
    locking a particular resouce and kill the session or whatever action. Kinldy help me experts please.

    This will give you an output like:
    LOCKED                           OUSER                SID
    OWNER.LOCKED_TABLE               LOCK USERNAME        '26,57010'and with the statement:
    alter system kill session '26,57010';you are able to kill the locking session.

  • Could Not Reserver Record(2 tries)

    Hi !
    -- Some time when i commit the record, the message appears
    "Could Not Reserve Record (2 tries), Keep trying"
    YES NO
    -- Please tell me about this error.
    -- May be due to locking of record.
    --I am using Forms 6i, with 10g.
    -- My application is multiuser, and all the users uses the common schema.
    Thanks!.

    Question:- Are you getting this error everytime you are running the form??????
    ==================================================
    This error would come when you are trying to update a record which is currently being used/updated somewhere else.
    By this i mean if you have a screen with emp table and you scroll down to KING's record and then edit his salary, BUT DO NOT COMIT yet. At the same time if someone else has opened this record in some other PC and trying to update the record then you would get this error.
    The Other possible reason could be DB level TRIGGER. Please check the DATABASE level triggers on the base table of the form. Try disabling the trigger and run the form again.
    Hope this helps.
    Please mark the question as answered/helpful if the reply helped you

  • Could not reserve record...

    Hello friends at www.oracle.com ,
    when I'm querying some data at Forms, sometimes I meet the message "Could not reserve record (2 tries). Keep trying?" (because other user is querying the same rows), and this message goes on, annoying me until the other user releases the rows, so I can continue querying them.
    What are the possible reasons for these rows to be locked? Usually I look at "locking mode" property from the block, but its locking mode is always automatic, and I wonder what other possibilities we could have for it to be happening.
    I want to add the following comment: a similar problem was solved in a Forms program, when 2 non-database items were synchronizing with other 2 database items (I broke the synchronization between them, because it wasn't needed, and the question above wasn't made anymore), but I see no apparent link between locked rows and their synchronization.
    If I wasn't clear, please ask me. Thanks for all answers.
    Best regards,
    Franklin Gonçalves Jr.

    Hello all,
    sorry if I wasn't clear. Let me try to explain it better:
    Let's suppose there are 2 users querying the same data. I think 2 users can simultaneuously query the same data, but not update them at the same time. Both can, at least, view the same data.
    However, there are situations when 2 users are querying and one of them gets the message "Could not reserve record (2 tries). Keep trying?".
    Here it's common to see 2 or more users querying the same data. Wish I could avoid the question above so users can see the requested data without the mentioned question, that might make no sense for them.
    I'd like to know what are the possible reasons for this question to appear, and how it can be solved. And yes, in some programs there are triggers like POST-QUERY, but I haven't noticed any update at all.
    If I was not clear again, please tell me.
    Best regards,
    Franklin Gonçalves Jr.

  • Error - could not reserve record

    This is in oracle forms 10G/win xp
    I am getting this message: Could not reserve record (2 tries). Keep trying?
    The code that causing this error:
    select count(*) into :blk.recordcount from mytable where xid= :blk2.xid;The field is updateable. When I run this query in toad I get the desired number. I am the only who access the table.
    Any idea about this error?

    Hi Wency
    Yes, this could be if u r running 2 instances of this form in the same pc;this happens with me after Executing the Query.
    it's not a condition to update or create only...
    When u got it again u can either do the following:
    1.Click No in response to the message. Do not keep trying to reopen a locked record.
    Pls Note*: your form locks every record it fetches
    2.Wait 1 minute and try to reaccess the record could possibly someone is sharing u same table.
    3.There is 1 way i don't recommand really to get remove from this message is :
    go to Data block property palette > Database Locking Mode > Default Automatic Set it to Delayed. then you can't received this error...
    cause it has a draw back but i leave the choice according to ur form bussiness requirements to decide.
    4.To show if there are any blocking database locks and if so - which user is locking the Database
    use the following queries to get the information you want.
    SELECT * FROM v$LOCK ;
    SELECT * FROM V$LOCKED_OBJECT ;v$session and dba_waiters are two other useful tables u or any one may need...
    Hope this helps...
    Regards,
    Abdetu...
    Edited by: Abdetu on Jan 18, 2011 2:06 AM

  • Could not reserve record problem

    Hi, I've got the following situation:
    I fill a block and it has a post-block trigger. So after the block is filled with data the post-block trigger fires.
    that trigger does the following: It checks whether a certain field is null or not. if the field is not null then it refills the block with different data. (It writes the data over the previous data since you cannot do a clear_block in the trigger)
    now, that all goes fine.
    But when I want to update that block it gives me the error: could not reserve record..
    this is my update code:
    PROCEDURE BUT_UPDATE_BILL_ADDRESS IS
         address1     varchar2(150);
         house_number     varchar2(150);
         bus_number      varchar2(150);
         postal_code_id      varchar2(150);
         city          varchar2(150);
         country          varchar2(150);
         al_account_id     varchar2(150);
         al_acct_location_id varchar2(150);
         account_id varchar2(150);
         acct_location_id varchar2(150);
         notes          varchar2(150);
         extern_billing_address     varchar2(150);
    BEGIN
    --save the data in temp variables.
         address1 := :account_location.address1;
         house_number := :account_location.house_number;
         bus_number := :account_location.bus_number;
         postal_code_id := :account_location.postal_code_id;
         city := :account_location.city;
         country := :account_location.country;
         al_account_id     := :account_location.al_account_id;
         al_acct_location_id     := :account_location.al_acct_location_id;
         account_id := :account_location.account_id;
         acct_location_id := :account_location.acct_location_id;
         notes := :account_location.notes;
         extern_billing_address := :account_location.extern_billing_address;
         --clear the account_location block
    -- if you don't do this you'll have touble with the update since the commit thinks its an update for the record that was inserted first (remember the post-block trigger)
         go_block('account_location');
         clear_block(no_validate);
         --fill the text items again
         :account_location.address1 := address1;
         :account_location.house_number := house_number;
         :account_location.bus_number := bus_number;
         :account_location.postal_code_id := postal_code_id;
         :account_location.city := city;
         :account_location.country := country;
         :account_location.al_account_id := al_account_id;
         :account_location.al_acct_location_id := al_acct_location_id;
         :account_location.account_id := account_id;
         :account_location.acct_location_id := acct_location_id;
         :account_location.notes := notes;
         :account_location.extern_billing_address := extern_billing_address;
    -- set status to changed (this isnt directly possible, you have to put the status tot query first)
    set_record_property(1, 'account_location', status, query_status);
    set_record_property(1, 'account_location', status, changed_status);
    commit;
    --refresh
    go_block('account_contact_main');     
    execute_query;
    what is causing the could not reserve record....? What action keeps the record busy? (I'm just a student)
    thanks in advance

    Without seeing more of your form, it is hard to say what is causing the message you are getting, or for that matter, which line of code is causing it.
    But I can say this: If this ACCOUNT_LOCATION block is a base-table block, then emptying the record and refilling the fields like you are doing will just get you into a mess.
    If you clear the block and enter values in an empty record, that record is now ready to be inserted as new row in the database. If you have a record you have queried into the block via the Execute_Query command, and you change its values, it is ready to be updated on the database.

  • Woarning message: could not reserve record

    Hello expert:
    when we fetch record from d2k form , warning message is displa:
    could not reserve record(2 tries), keep trying? yes/no
    on clicking no, show
    anable to reserve record for update or delete.
    please tell me what kind of error is this?
    thanks n regards
    yash

    when we fetch record from d2k form , warning message is displa:
    could not reserve record(2 tries), keep trying? yes/noI think have you used reserved words? please post the error message you are facing.
    Thanks

  • Problem: DPM could not reserve the drive resource because one of required drive resources is not online or it needs cleaning or servicing. (ID 24052)

    Hi, 
    Is there any way I can get around this problem (see notes below)?
    Here is the problem I am having:
    Type:     Dataset copy
    Status:  Failed
    Description:        DPM could not reserve the drive resource because one of required drive resources is not online or it needs cleaning or servicing. (ID 24052)
    Here is why it is happening (Background)
    Supported and unsupported scenarios in DPM
    http://technet.microsoft.com/en-us/library/dn554221.aspx
    Multiple long-term tape goals that use dataset-copy jobs fail if you only have a single tape drive
    Issue: DPM doesn’t support multiple long-term backup goals if you only have a single tape drive.
    Workaround: Add a second tape drive to DPM or to the tape library.
    Notes:
    I have verified that the option for the number of tape copies is not greater than 1 for any protection goal in any of the 3 protection groups.
    I do have multiple long-term backup goals, and I only have a single tape drive.  I don’t want to add a second tape drive to DPM or to the tape library.  I think this is a ridiculous solution.  I was thinking of creating two types of backup
    jobs for ones for short term backups and for one larger job long term backups (weekly and monthly).
    The tape backups complete, just the "Dataset copy" doesn't happen.
    Environment:
    Windows Server 2012
    SCDPM 2012 R2
    Tape backup library, with one drive.

    Hi,
    I understand your frustration but unfortunately there is no workaround for this issue.  I have brought this issue up with the product group for consideration for future enhancement. 
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

Maybe you are looking for

  • Troubleshoot Main Image for spry photo gallery

    Hello, I am modifying some spry files to see if I can get the hang of it using my images. I have taken the photo gallery files gallery.js SpryData.js SpryEffects.js xpath.js The folder structure contains images and thumbnails on the root folder as we

  • AT1 value not showing in excise JV in j1ih

    Dear SAP gurus,                          in j1ih, when I am giving the doc number of PLA hold and PLA BED,CESS,ECS, it is not capturing the value of HCess which i have maintained in AT1..though i haved ticked AT1 in the excise register.It is not even

  • Related to ME22N

    Hi i needed to change Purchase order automatically . i got confusion to use BDC ,BADI. my friend told that ME22n transaction sometimes will not work in bdc recording . so better go for ME22 .but in ME22 ,copy function is not working i m in need to kn

  • How to add custom button to Insert tab?

    Hello! I want to add my own button to the Insert tab. This is the tab where there are buttons like h1, h2, ul, ol etc. I often need the code tag, but this tag is not avaible in the Insert tab. So how to add a custom?

  • Contact

    I've noticed that some of my contacts doesn't appear in my contacts on my iPhone 5, OS 6.1.3. I have enable the phone to show all contacts. The reason why I know the contact exists, is because, if I start typing the contacts name in a new text messag