On-Lock Trigger and Releasing the Lock

I have a data block which has a View as a Datasource.
I want to update some fields from that View so I use On-Lock and On-Update triggers.
In the On-Lock trigger I use a select for update nowait to lock the row.
My problem is that if I don't save the changes the lock is not released.
My problem is reproduced with the Following steps
1. Open two sessions of the form
2. Update field in one session. (The On-Lock trigger is fired)
3. Try to enter query in the Form.
4. The message Do you want to save the Changes? appears.
5. I answer No
6. I go to the second session
7. I try to update the same row and I get an error cause the Row is Locked.
Should I code another trigger? Should I issue a rollback somewhere ?
Thanks in advance.

Francois wrote:
Forms_ddl('ROLLBACK') will only rollback explicit SQL orders (Nothind done by Forms itself), so the risk is minimum because you lock the record when entering it then unlock it when exiting it.Is that documented anywhere? How can the Oracle database server tell the difference between row locks set by Forms automatic processing and locks expressly set by his "select for update"? Unless things have changed, a ROLLBACK removes everything... all locks, all posted changes, etc. You get a clean slate, ready to start over.
Dimitris:
I think you're going to have to re-think your application. I do not believe there is any way to unlock specific rows from one block, while preserving your uncommitted changes in others. Oracle and Forms simply do not work that way.
...unless you start setting savepoints each time the user goes in and updates a different block. Then you could potentially determine which savepoint was set, and do a rollback to savepoint. And managing that on a form with multiple updateable blocks could be a nightmare if the user bounces around from block to block making changes here and there.
It would be easier to just stop the user when he decides to enter a new query. If he has updated any other blocks, or even made changes to the block in question, then he needs to first commit, or you need to clear the entire form with a CLEAR_FORM(NO_VALIDATE,FULL_ROLLBACK);

Similar Messages

  • Locking a table and then releasing the lock...

    Gurus,
    I ant to lock a table DMS_LO_CD1 and then do certain upodate and then release the lock after that.
    How can I d this ?
    Thanks.
    Regards,
    Rajesh.

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    https://forums.sdn.sap.com/click.jspa?searchID=115258&messageID=2656474
    Do the following steps..
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Hope this helps.
    Regards,
    Midhun Abraham

  • How can we release the locked objects..

    Hi,
    I have created some objects such as pages and iviews in the portal. If i edited any of the object, then when next time when i access the object, I am hgetting a message as object is locked by admin, you canot edit it. Infact, I have logged in as admin.
    How can we release the lock of objects?
    Your help and suggestins solicited...
    Best regards,
    Sudhesh...

    Login as the Portal Administrator.
    Go to System Administration > Monitoring ->Detailed navigation -> Object Locking
    Here you can find all the objects that are in locked state.
    Now to unlock,  tick mark the object that you want to work with & click on the "Unlock" Button.

  • Kill a session and release all locks immediatly

    Hi,
    How to kill a session and release all locks immediately.
    Thank you
    AK

    > Actually I am working on development envrionment (Not
    production) with oracle 10g DB. What heppened is that
    I needed to replace a stored DB Package, but I
    couldn't even when I am the only connected user.
    A read lock is placed on data dictionary objects when used - that prevents someone else from changing that data dictionary object and in effect pull the carpet from beneath the feet of the process using that object.
    When trying to replace a package, it will fail if another session is busy using that package.
    As for being the only user on the database and still running into this problem - there could have been a DBMS_JOB executing that package.
    > I killed all sessions, and even next day still the
    locks are there from a session I killed 1 day
    before!
    Unusual. But a killed session can take 24+ hours to rollback. A rollback is often a lot more time consuming than the elapsed run-time of the session at the time it was killed.
    Back with Oracle 8i and prior, it was not uncommon to see a killed session lingering forever until the instance was bounced. But I have not yet seen this in 10G.
    Suggest that when you run into this situation again, you monitor the killed session to determine just what it is doing (looking at its current wait states and events) - and whether it is indeed hanging and not releasing any locks that should have been released.

  • I just upgraded to Firefox 5.0.1 and since the "lock" icon never appears when accessing secure websites, where should I look for it?

    I just recently upgraded to Firefox 5.0.1 and now the "lock" icon doesn't appear anywhere (I can find) when accessing secure websites. I haven't seen it once. It used to appear in the lower right corner of the screen. I also have Norton Internet Security.

    Padlock is no longer part of Firefox; it was removed beginning in Firefox 4. The padlock shows that there is a secure connection but does not supply additional information. You could have made a typographical error and still have been connected to a secure connection. The padlock was replaced in Firefox 3 with the Site Identity Button. Familiarize yourself with the Site Identity Button at the left end of the Location Bar:
    *https://www.mozilla.com/en-US/firefox/security/identity/
    *https://support.mozilla.com/en-US/kb/Site+Identity+Button
    *http://www.dria.org/wordpress/archives/2008/05/06/635/
    You can install this add-on if you wish: *https://addons.mozilla.org/en-US/firefox/addon/padlock-icon/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Have a 4S and in the lock screen it is coming up with a screen (Not Enough Storage - This iphone cannot be backed up because there is not enough iCloud storage available. You can manage your storage in settings) it then has option close or settings.....bu

    I have a 4S and in the lock screen it is coming up with a screen (Not Enough Storage - This iphone cannot be backed up because there is not enough iCloud storage available. You can manage your storage in settings) it then has option close or settings.....but i am unable to click on either or turn off the phone. I have plugged it into itunes on the computer and manually backed it up but i cannot use my phone as i cant get past this message

    Welcome to the Apple Community.
    You might try a forced shutdown to begin with, hold down the top and home buttons together until the device shuts down, then restart it.

  • Got a black screen on the iPod Touch 4th Generation. Tried restoring it and holding the lock and hold buttons but this didnt work. Do i need a brand new screen?

    Got a black screen on the iPod Touch 4th Generation. Tried restoring it and holding the lock and hold buttons but this didnt work. Do i need a brand new screen?

    If you successfully restored to factory settings/new iPod via iTunes (Not via Settings>General>Reset>Erase all Content and Setting) and still have the problem that indicates a hardware problem. Could be the screen or something else.
    Make an appointment at the Genius Bar of an Apple store..
    Apple Retail Store - Genius Bar

  • Release the lock for objects in ABAP webdynpro

    Hi All,
    I need to release the lock of certain objects during the application close(When the user closes the browser)
    Can I release the lock of the objects other than the method WDDOEXIT method.  If yes please tell me how?
    The reason being WDDOEXIT is not called during the close.
    Thanks,
    Subash M

    >
    Subash Mohanvel wrote:
    > Hi All,
    > I need to release the lock of certain objects during the application close(When the user closes the browser)
    > Can I release the lock of the objects other than the method WDDOEXIT method.  If yes please tell me how?
    >
    > The reason being WDDOEXIT is not called during the close.
    >
    > Thanks,
    > Subash M
    I think the bigger question is to why WDDOEXIT is not called. What you describe is exactly what WDDOEXIT is designed for.  This is the part of the phase model that is fired when the session times out or the browser closes. This should work for just this purpose.

  • My screen just locked up and displayed the following pattern. Any ideas why?

    Hello,
    My computer went to sleep and when I awoke it and opened up safari browser, the screen locked up and displayed the attached pattern on my screen.  I could still use the mouse but couldn't click on anything.  I had to reboot.
    Any ideas what could be wrong?

    If it will repeat after restart - hardware problems. Most probably memory.
    Anyway run Apple Hardware Test

  • Sometimes my iPad1 locks up and has the flat battery graphic after charging all night, but will not work until you disconnect the charger, then it reboots and the battery is fully charged and works normally

    Sometimes my iPad1 locks up and has the flat battery graphic after charging all night, but will not work until you disconnect the charger, then it reboots and the battery is fully charged and works normally.
    It has only happened for the last month or so
    Also, sometimes it drops out of apps, ie facebook etc. just like you have hit the stop button

    Who replaced the battery? If it wasn't Apple the replacement is probably bad also. Either that, or the logic board is bad.

  • Ipod keeps locking up and flashing the apple logo

    my ipod keeps locking up and flashing the apple logo. it seams to try to open but it stays locked. i did a restore to it but it froze up again

    what did you do to fix the problem?

  • Suppress and release the sales document field.

    How can we Suppress and release the fields in sales document. Eg. I want to suppress Qty field in sales document item. Please respond ASAP.

    REFER BELOW
    Supressing Fields in Sale Order
    To make optional / mandatory you can use in IMG - S&D-> Basic > Functions-> Log of incomplete Procedures =>  select the fields > from the tables and the system will check for them (OVA2/VUA2)
    To make a filed entry enabled or grey (non-entry allowed):
    User exits in the program MV45AFZZ-USEREXIT_FIELD_MODIFICATION
    This user exit can be used to modify the attributes of the screen  fields.
    To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP.
    If a field has no field name, it cannot be allocated to a group. The usage of the field groups (modification group 1-4) is as follows:
    Modification group 1: Automatic modification with transaction MFAW
    Modification group 2: It contains 'LOO' for step loop fields
    Modification group 3: For modifications which depend on check tables or on other fixed information
    Modification group 4: is not used
    The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit. This FORM routine is called up by the module FELDAUSWAHL.
    Actually suppressing fielding sales orders userwise is quite easy. We are doing it in our company. For this we use userexit FORM USEREXIT_FIELD_MODIFICATION in MV45AFZZ.
    Below is the sample code
    IF SCREEN-NAME = 'VBKD-ABSSC'.
    AUTHORITY-CHECK OBJECT 'ZMV45AFZZ' ID 'SCRFNAME' FIELD SCREEN-NAME.
      IF sy-subrc = 0.
        SCREEN-INPUT = 1.
      else.
        SCREEN-INPUT = 0.
      ENDIF.
    endif.
    You place the authority check object in authorization profile in the role of the users, who should have access to the field (in this case it is VBKD-ABSSC), and there assign the corresponding fields that are to be accessed via this user exit.

  • I suddenly have two flashing lights on my keyboard by the caps lock key and over the end/pg up key.

    I encountered a problem waking my laptop (Pavilion dv7-1270us) this morning.  At first it would not wake up and had to do a hard reboot.  Now I have two flashing lights on the keyboard -the caps lock light and the one over the end/pg up keys over the number pad.  I have run several diagnostics and cannot find an answer as to what this is.
    This question was solved.
    View Solution.

    Hi,
    You're welcome and it's good to hear you've got it working
    All the best,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • How do I get my iPad to open to the lock screen and NOT the passcode panel when I open my cover

    When I open the cover to my iPad Air it is open to the 4digit passcode screen and NOT my lock screen with the date and time. When I go to settings under Touch ID and passcode I see 'require passcode' immediately with a check near it.  When I click on that and try to UNcheck it, nothing happens.  How do I get my iPad to open to the lock screen

    When I open the cover to my iPad Air it is open to the 4digit passcode screen and NOT my lock screen with the date and time. When I go to settings under Touch ID and passcode I see 'require passcode' immediately with a check near it.  When I click on that and try to UNcheck it, nothing happens.  How do I get my iPad to open to the lock screen

  • I was using my iPad and then I locked it and now the screen wont light up and when I plug it into iTunes it doesn't show up under devices

    I was using my iPad one morning looking at ebay, and then I locked it and came back and when I clicked the home button nothing happend. When I clicked the lock button nothing happened, when I plugged it into iTunes nothing happened and it didn't show uunder "Devices" on to side. Please help me I don't know how to fix this and it's been two days since it happened.

    I would then try and do a hard reset like Fernando recomends if that doesnt work you might need to try a DFU Restore.
    How To DFU Restore

Maybe you are looking for

  • Since upgrading to Mountain Lion my computer crashes almost every night

    In the morning I have to push the power button even though the sleep is set to never. It turns out that sometimes during the night and actually usually very close to the morning after there was a kernel panic. panic(cpu 0 caller 0xffffff801bc88aac):

  • Why is my macbook running so slow?

    EtreCheck version: 2.1.6 (109) Report generated January 16, 2015 at 1:26:28 AM EST Download EtreCheck from http://etresoft.com/etrecheck Click the [Support] links for help with non-Apple products. Click the [Details] links for more information about

  • Black background in pages 5?

    Could somebody tell me please where is the black background in the full screen view of pages 5? Now, in the new version we can have just that gray one? Black was much better to write... g

  • Location of UWL data in the database

    Hi, where exactly in the database does the data of UWLs get stored (table)? I guess I could figure it out by entering some data into a UWL and then searching in the database, but I have some infrastructural problems here. Thanks, Ingmar

  • 2 iPods into 1 iMac?

    Hi again folks, I currently own a 30GB iPod Photo but I'm buying my sister a 2GB iPod Nano for her Christmas. I was just wondering if it's safe to change between which iPod is plugged into the Firewire or USB socket? Obviously, I won't have both plug