Row lock issue when doubleclicking field

hi all,
i hav this confusing scenario on my oracle forms 6i.
i have this field that can be enabled trough onmouse double click (with set item propert, update_allowed) that allows user 1 to update current data.
when user 2 opens the same page where that field is located, and tries to edit that certain field, i encounter an error stating that user 2 could not access the field.
my database returns a row lock contention.
is there anyway that 2 users could be able to edit transactions simultaneously?
thanks in advance

oradba11 wrote:
Hi,
I am wokring on oracle 10.2.0.4 rac 2 node nistances on AIX.
We have one table having multiple rows defilning jobs will be done by users ...the functionatily is that ..when even one user will pick on row (job) , one update
statement will issue and it will update status column to 1 which menas job is allocatated , this means now this should not allocate to any other user ..
but we are facing issue that once any user will pick that job , in applicatoin log files we can see that row gets lock and updates the status to 1 . but then also
users connecting to other or some time same instance will get that job...means multiple users can pick same job .. even after already picked by other user ..
Is this can be issue with rac configuration ... like when ever one user updates a row ..it will be in cache of one instance and when other user trys to again update
2nd instance does not have that information and allows user connected to that instace to pick that job..like delay in block tranfer or cache fusion..
is this can be issue with rac or it is purely application issue...
any idea...In principle this is not possible - it's either an application error or a fundamental and catastrophic Oracle bug that people would have made a huge fuss about years ago (and I don't recall hearing such a fuss).
Regards
Jonathan Lewis

Similar Messages

  • Row locking issue with version enabled tables

    I've been testing the effect of locking in version enabled tables in order to assess workspace manager restrictions when updating records in different workspaces and I have encountered a locking problem where I can't seem to update different records of the same table in different sessions if these same records have been previously updated & committed in another workspace.
    I'm running the tests on 11.2.0.3.  I have ROW_LEVEL_LOCKING set to ON.
    Here's a simple test case (I have many other test cases which fail as well but understanding why this one causes a locking problem will help me understand the results from my other test cases):
    --Change tablespace names as required
    create table t1 (id varchar2(36) not null, name varchar2(50) not null) tablespace XXX;
    alter table t1 add constraint t1_pk primary key (id) using index tablespace XXX;
    exec dbms_wm.gotoworkspace('LIVE');
    insert into t1 values ('1', 'name1');
    insert into t1 values ('2', 'name2');
    insert into t1 values ('3', 'name3');
    commit;
    exec dbms_wm.enableversioning('t1');
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM1');
    exec dbms_wm.gotoworkspace('TESTWSM1');
    --update 2 records in a non-LIVE workspace in preparation for updating in different workspaces later
    update t1 set name = name||'changed' where id in ('1', '2');
    commit;
    quit;
    --Now in a separate session (called session 1 for this example) run the following without committing the changes:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --Now in another session (session 2) update a different record from the same table.  The below update will hang waiting on the transaction in session 1 to complete (via commit/rollback):
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    I'm surprised records of different ids can't be updated in different sessions i.e. why does session 1 lock the update of record 2 which is not being updated anywhere else.  I've tried this using different non-LIVE workspaces with similar results.  I've tried changing table properties e.g. initrans with and still get a lock.  The changes to table properties are successfully propagated to the _LT tables but not all the related workspace manager tables created for table T1 above.  I'm not sure if this is the issue.
    Note an example of the background workspace manager query that may create the lock is something like:
    UPDATE TESTWSM.T1_LT SET LTLOCK = WMSYS.LT_CTX_PKG.CHECKNGETLOCK(:B6 , LTLOCK, NEXTVER, :B3 , 0,'UPDATE', VERSION, DELSTATUS, :B5 ), NEXTVER = WMSYS.LT_CTX_PKG.GETNEXTVER(NEXTVER,:B4 ,VERSION,:B3 ,:B2 ,683) WHERE ROWID = :B1
    Any help with this will be appreciated.  Thanks in advance.

    Hi Ben,
    Thanks for your quick response.
    I've tested your suggestion and it does work with 2 workspaces but the same problem is enountered when additional workspaces are created. 
    It seems if multiple workspaces are used in a multi user environment, locks will be inevitable which will degrade performance especially if a long transaction is used. 
    Deadlocks can also be encountered where eventually one of the sessions is rolled back by the database. 
    Is there a way of avoiding this e.g. by controlling the creation of workspaces and table updates?
    I've updated my test case below to demonstrate the extra workspace locking issue.
    --change tablespace name as required
    create table t1 (id varchar2(36) not null, name varchar2(50) not null) tablespace XXX;
    alter table t1 add constraint t1_pk primary key (id) using index tablespace XXX;
    exec dbms_wm.gotoworkspace('LIVE');
    insert into t1 values ('1', 'name1');
    insert into t1 values ('2', 'name2');
    insert into t1 values ('3', 'name3');
    commit;
    exec dbms_wm.enableversioning('t1');
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM1');
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = name||'changed' where id in ('1', '2');
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    --end of original test case, start of additional workspace locking issue:
    Session 1:
    rollback;
    Session 2:
    rollback;
    --update record in both workspaces
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM2');
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = name||'changed2' where id in ('1', '2');
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this now gets locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --update record 3 in TESTWSM2
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating LIVE
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating TESTWSM1 workspace too - so all have been updated since TESTWSM2 was created
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating every workspace afresh
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changedA' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changedB' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = 'changedC' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;

  • User Lock issue when processing IDOCS

    Hi Folks,
    We are pushing the data into SAP using IDOCS.During this process some IDOCS are getting failed due to User Lock on shipment header.Anyone here can share their experience in dealing with User Lock issues.
    Thanks,
    Kiran.

    Kiran,
    Only one can edit the document, it's standard fucntion. I think No note can resolve this. I can suggest you to run a back ground job very frequently ,which picks these status 51 IDOCs and reprocess. Report is :RBDMANi2
    We can use Message class & error message number on selection screen, so that we can make sure that only those idocs which were failed due to Lock problem are taken by the job.
    Reddy

  • Issue when few fields were added to a custom table

    Hi,
    We have added some new fields to the existing database table(Customize). One of the fields is POD_date (data element- sydatum).
    When we look for entries in table with condition POD_DATE EQ '00/00/0000' or space it gives fewer entries. In place it has to give 18k old entries with 00/00/0000 which it doesnt. Ideally it should have done '00/00/0000'  for all older records as there wasnt field at that time. When fetch without above condition it gives 18k records with field in POD (00/00/0000) but when same thing is given in selectioon criterion it gives fewer.
    Regards
    Mohinder
    Edited by: Mohinder Singh Chauhan on Dec 14, 2009 1:26 PM

    Dear all,
    I encounter quite the same problem :
    We added an include to the table EKKO containing several fields such as ZZTYPC.
    The initialization flag was not set at creation time so the new fields were populated with the NULL value.
    We would like now to initialize the value for all the records of the field ZZTYPC to avoid problems when we use this field as a selection criteria in Tx SE16.
    As suggested in the previous post, I checked the initilization flag for this field at the structure level (Dictionary : Display structure), save & activate but the modification is not carried over the table EKKO : the "initial values" check box stays unchecked for the field ZZTYPC thus the adaptation of EKKO is useless.
    We use DB2 as database.
    You help would be appreciated.
    Best Regards,
    Olivier

  • Optimistic Locking fails when version field is part of a Aggregate

    I'm trying to persist a Mapped Object using 9.0.3 Toplink.
    The object uses optimistic locking while the Timestamp versioning field is part of an Aggreate Descriptor. This works well in the Workbench (does not complain).
    Unfortunally it does not work whenever I use the UnitOfWork to register and commit the chances.
    Sample code:
    Object original;
    UnitOfWork unitOfWork = ...          
    Object clone =   unitOfWork.registerExistingObject(original);
    clone.setBarcode("bliblalbu");
    unitOfWork.commit();This throws an nasty OptimisticLockException, complaining about a missing versioning field:
    LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-5004] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.OptimisticLockException
    EXCEPTION DESCRIPTION: An attempt was made to update the object [BusinessObject:{id:12382902,shorttext:null,barcode:bliblablu,ownerLocation:null,IdEntryName:0,idCs:20579121}], but it has no version number in the identity map.
    It may not have been read before the update was attempted.
    CLASS> de.grob.wps.domain.model.BusinessObjectBO PK> [12382902]
         at oracle.toplink.exceptions.OptimisticLockException.noVersionNumberWhenUpdating(Unknown Source)
         at oracle.toplink.descriptors.VersionLockingPolicy.addLockValuesToTranslationRow(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.updateObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitAndResume(Unknown Source)
         at de.grob.wps.dwarf.domainstore.toplink.ToplinkTransaction.commit(ToplinkTransaction.java:60)
         at de.grob.wps.dwarf.domainstore.toplink.ToplinkPersistenceManager.commit(ToplinkPersistenceManager.java:396)
         at de.grob.wps.dwarf.domainstore.toplink.ToplinkPersistenceManagerTest.testPersistSerializableWithBusinessObjects(ToplinkPersistenceManagerTest.java:87)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)So what can I to fix this problem? BTW the Object I try to persists has been read from database and the IDE debugger shows what that the aggregate object contains java.sql.Timestamp instances.

    Sorry guys. My debugger fooled me. The locking field wasn't initialized in the database. This caused the problem which is fixed now.
    Thx anyway.
    Bye
    Toby

  • Speed issue when drawing field of Rectangles

    I'm working on a fullscreen java app that consists of a 320x320 field of randomly-colored dots, a variable percentage of which should eventually move in concert at up to 100 fps. Right now I'm simply working on drawing a varying field of dots on the screen at that speed. I'm using multiple buffers with the help of the MultiBufferTest example from Sun's Full Screen Exclusive Mode API tutorial. The demo runs great, pages flipping at what appears to be the speed at which I need my graphics to appear on the screen, but the demo draws only one Rectangle.
    The problem I'm having seems to be the speed at which my 102400 Rectangles are being drawn on one of the back buffers before being flipped onto the screen. Right now I'm working with 3 buffers, but it doesn't seem to matter how many I use; the speed at which the field appears to plateau at around 1 fps. Some thoughts:
    * My random color generation code is outside of the rendering loop.
    * I've casted the Graphics object into a Graphics2D object g2, but that hasn't helped.
    * The Rectangles are drawn inside nested for loops by row (r) and column (c) using g2.fillRect(c * mSide, r * mSide, mSide, mSide); where mSide is the side length of each Rectangle.
    * Is it possible to draw all the frames into a Vector of buffers before the 'animation' begins? Presumably it would still take around 1 second to generate each frame that will appear, so that probably wouldn't work too well.
    * I have the O'Reilly book Java 2D Graphics, but it doesn't help much in this situation.
    I'm a novice at Java and a novice at graphics programming to boot, so is there anyone out there that can give me some advice on how to speed up the graphics generation?

    I'm working on a fullscreen java app that consists of a 320x320 field of randomly-colored dots, a variable percentage of which should eventually move in concert at up to 100 fps. Right now I'm simply working on drawing a varying field of dots on the screen at that speed. I'm using multiple buffers with the help of the MultiBufferTest example from Sun's Full Screen Exclusive Mode API tutorial. The demo runs great, pages flipping at what appears to be the speed at which I need my graphics to appear on the screen, but the demo draws only one Rectangle.
    The problem I'm having seems to be the speed at which my 102400 Rectangles are being drawn on one of the back buffers before being flipped onto the screen. Right now I'm working with 3 buffers, but it doesn't seem to matter how many I use; the speed at which the field appears to plateau at around 1 fps. Some thoughts:
    * My random color generation code is outside of the rendering loop.
    * I've casted the Graphics object into a Graphics2D object g2, but that hasn't helped.
    * The Rectangles are drawn inside nested for loops by row (r) and column (c) using g2.fillRect(c * mSide, r * mSide, mSide, mSide); where mSide is the side length of each Rectangle.
    * Is it possible to draw all the frames into a Vector of buffers before the 'animation' begins? Presumably it would still take around 1 second to generate each frame that will appear, so that probably wouldn't work too well.
    * I have the O'Reilly book Java 2D Graphics, but it doesn't help much in this situation.
    I'm a novice at Java and a novice at graphics programming to boot, so is there anyone out there that can give me some advice on how to speed up the graphics generation?

  • Locking issue with BAPI_GOODSMVT_CREATE in userexit_save_document

    Hello All,
    I am performing a separate goods movement for one of the materials in the delivery userexit_save_document during PGI. I have an issue. We might have multiple users trying to PGI deliveries and thereby performing the goods movement for the same material through the BAPI in the userexit_save_document.
    How do I prevent the locking issue when say two users go through the BAPI for goods movement for the same material data at the same time.
    Any answer in this regards is highly appreciated.
    Thanks,
    Mathangi

    Thanks Rich... this make work for me, but one question -
    Do you know if this function releases all lock objects for the user system wide or only for the current session? My concern is that if it is system wide, then I could be releasing lock objects for other sessions unintentionally. For example, if there are multiple RFC calls in parallel for the same function and same user then I could be destroying lock entries that I shouldn't be! I am hoping that it removes lock entries only for the current session...
    any ideas?
    Regards,
    Lee
    > I've used this BAPI in many of my programs,  and
    > always after the call, I code.....
    >
    >
    >
    >     commit work and wait.
    >     call function 'DEQUEUE_ALL'.
    >
    >
    >
    > The DEQUEUE_ALL show release any/all locks.
    >
    >
    > Regards,
    > Rich Heilman

  • Details section extends to a whole page when multipage field is printed

    Crystal Reports designer in VS 2005 Prof.  C#
    I have a field which sometimes is large, so it is printed on several pages.
    When a field is small, ie. starts and finishes on the same page, then all is OK. I mean, that Details vertical lines and field borders are closed as soon as the last field is fully printed. Report Footer is propely printed after the last Details row.
    But when a field occupies several pages then, on the last page, the Details section is not closed after the last row but extends to a whole page.
    So, as a result of this behavior, the Report Footer is printed over the Detail's vertical lines. This is my problem.
    I tried the following:
    1. Change setting Keep Object Together - does not help.
    2. Inserting an extra Group Section - Group Footer was printed over on Details body - overlapped.
    To show this problem here are 2 pictures. Please pay attention to the column "Odcinki".
    [The view with a small field|http://www.zgadzaj.pl/temp/KIM_Dobry.jpg]
    [The view with Details expanded to a whole page|http://www.zgadzaj.pl/temp/KIM_Usterka.jpg]
    Marek

    Hi Trevor and Ludek,
    At last success -  I found the workaround!
    Before my give up, during the downloading time of the PerpetuumSoftware report generator, I tested the last idea which comes from [Joe's help posted in this thread|http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/77b28835-12aa-4592-bcc8-c2b8dbf49317].
    I removed all vertical lines from the Detail section and the box surrounding the Detail's section row.
    I inserted a new group section which works exactly as the Detail section, so it changes along with Detail section.
    I put the vertical lines starting from the GroupHeader section and expanded it across the Detail section to the middle height somewhere inside the GroupFooter. And now I set the line's bottom = 0. It means that it ends exactly at the top of GroupFooter section.
    Next, I set the height's of GroupHeader and GroupFooter sections = 0.
    The import things are:
    - vertical lines (box'es) cannot start in the PageHeader, they must start at top of GroupHeader
    - vertical lines (box'es) cannot end in the Detail section, they must end at top of GroupFooter
    And now, it works as I expected. Here is the [PDF example|http://www.zgadzaj.pl/temp/KIM_OK.pdf].
    Thanks to your advices and support I was able to investigate this problem,
    so thank you again for the help.
    Regards,
    Marek

  • PC Netlink 2.0 locking issue

    Our server is runnig Solaris 9 and uses PC netlink 2 to serve to windows clients. We are experiencing strange locking issues when accessing the network file system from windows clients. Files intermittently appear to have some sort of lock on them which stops them from being deleted, moved, or renamed for 10 or so minutes. We are also experiencing issues when some windows applications try and write files to the network file store. It is very slow and will occasionally report that the 'server is busy'. Does anyone have any advice or suggestions on how to tackle this problem? Thanks.

    I have the same Problem; no solution yet.
    Accroding to Sun Support Doc # 72542.
    PC Netlink is based on NT 4.0 Server.
    At the highest level it implements NT 4.0 protocols.
    .NET clients, such as Windows 2003, implement a different protocol.

  • How and when the database release a row lock?

    Dear experts,
    We are using the following statement to obtain a row lock in a table in the database(ORACLE of course),
    SELECT * FROM {TABLE_NAME} WHERE ID = 1 for update
    and if we succeed grabbing the row lock we will continue to issue a update statement every 30 seconds to preserve the lock as far as possible.
    here is the update statement to preserve the lock,
    UPDATE {TABLE_NAME} SET time = ? WHERE ID = 1.
    As you see more longer we keep holding the row lock , more update statements are submitted in the pending transaction.
    In normal case our application can grab the exclusive row lock and works for a long time,however sometimes a connection reset exception is thrown
    and our application will close the connection(I assume the pending transaction will be rolled back by the database) and exit the JVM.
    Since other applications will keep trying to grab the same row lock to become the master role,
    we expect one of them can succeed but they are all failed because the database has not released the row lock as expected.
    Can someone explain more details about how and when the row lock can get released in our use case?
    Thanks,
    SuoNayi
    Edited by: SuoNayi on 2013-5-30 上午8:12

    Hm. Is this part of an XA transaction by any chance? I know that Oracle maintains separate bookkeeping for such transactions which can cause rows to stay 'locked' even when the regular DBA views will indicate there is no user currently locking the record at all. I have no idea about the actual details and what you need to do to clean up such a situation, that is something a DBA should know and do.
    If not... well this is more of a question for people who know the DBMS, which makes it a target for the Oracle DBMS forums. Java developers don't tend to have DBA-level knowledge of the database, you should ask the question where you have more chance of people with expertise answering stuff:
    General Database Discussions

  • Editable ALV issue: When Delete/Modify a row, ztable doesnt reflect changes

    Greeting Fellow Abapers,.
    I have been running into an issue that I need some advice on.  I am allowing users to edit a Ztable via ALV.  When the quantity field is updated everything is fine. However, when the field "lic_plate" is edited the code appends another row into the Ztable instead of modifying it.  Also, when the delete row functionality of the grid is used the row is not deleted from the Ztable.
    Here is the ztable structure. The fields I allow to be edited are in BOLD...
    ZPALLET-VBELN
    ZPALLET-MATNR
    ZPALLET-LINE_NUM
    ZPALLET-LIC_PLATE
    ZPALLET-LOT_NUMBER
    ZPALLET-PAL_TYPE
    ZPALLET-MAN_DATE
    ZPALLET-QUANTITY
    ZPALLET-PROC_DATE
    Here is the source code that the APPEND is taking place...
    FORM save_database .
    Getting the selected rows index*
      CALL METHOD o_grid->get_selected_rows
        IMPORTING
          et_index_rows = i_selected_rows.
    Through the index capturing the values of selected rows*
      LOOP AT i_selected_rows INTO w_selected_rows.
        READ TABLE itab INTO wa INDEX w_selected_rows-index.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING wa TO w_modified.
          APPEND w_modified TO i_modified.
        ENDIF.
      ENDLOOP.
    IF sy-subrc = 0.
        MODIFY zpallet FROM TABLE i_modified.
    ENDIF.
    ENDFORM.
    Please help. I am in your debt.
    ...as always, points will be awarded.
    Best,
    Dan

    Hello Dan
    When you are using an editable ALV for table maintenance you have to take care that the users
    - cannot edit the key fields of existing DB records   and
    - every new record (row) does not match any existing record (i.e. has identical key field values)
    Instead of relying on selected rows for the DB update I would recommend to store a "PBO image" of your data and compare this with the "PAI image" of the data as soon as the user pushes the SAVE button.
    Example:
    DATA:
      gt_outtab_pbo    TYPE   < your table type>,  " PBO image
      gt_outtab           TYPE   < your table type>.  " PAI image
    " 1. Select data from DB table and store in both itabs:
      SELECT * ... INTO TABLE gt_outtab.
      gt_outtab_pbo = gt_outtab.
    " 2. Display editable ALV list -> user modifies gt_outtab
    " 3. SAVE function requested
    " ... compare gt_outtab vs. gt_outtab_pbo
    " .... INSERT, UPDATE, or DELETE DB records
    " Finally set:
      gt_outtab_pbo = gt_outtab.
    " 2. User continues with editing
    In order to compare PBO vs. PAI data you may have a look at my sample coding:
    [Comparing Two Internal Tables - A Generic Approach|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach]
    Regards,
      Uwe

  • Mapping Issue:Assign src field val to target when src field not exists

    Hi
    Pls guide though the following issue in Message Mapping
    I do have a segment of 0...n. where the target element is manipulated based on the three fields in source segment.
    <Source>
    Parent Segment (1..1)
         Segment     (0...n)
              Field_1  =  23k     
              Field_2  =      01
              Field_3  =  (either 'X' or No field in IDOC segment)
    <Target>
    Segment (1...1)
         t_Field  =  ( if ( ( Field_1 = '23K') & (Field_2 = '01'))  then  assign Field_3  )
    How can i check or handle this Field_3 issue when its not present in IDOC segment?
    Note: I am using UDF, and getting errors while retrieving Field_3 data when the field itself is not present in segment inside loop statement.
    Thanks,
    Vinod V

    Thanks Mickael for the reply,
    I have tried the same, and its working fine with the Display Queue. But giving following error while performing the Transformation Test.
    I found that in loop Field_3 returns value at first index only. It does not increment.
    Field_3's context is set to Parent Context.
    Please help with inputs.
    regards,
    Vinod V

  • Locking Issue in Planning DSO in SAP BW 7.3(Integrated Planning)

    Hi Experts,
    We have built Aggregation Level on Direct Update (planning enabled) DSO and used the same in the input ready queries.( Its complete Manual planning - new row addition feature in WAD).
    We have 5 characteristic and one key figure for planning.
    We are facing lock issue while planning the data i.e. when one user is planning, other user cannot plan.
    The lock relevant characteristic is Column A and the same has been added to the Lock Characteristic tab(RSPLSE) of the infoprovider. The input ready query is also restricted with a variable on Column A (manual input single variable- mandatory).
    While the user opens the Planning Layout and plans the data, we can see lock entry in RSPLSE(locks tab) for the Column A selection in the infoprovider, yet if another user is trying to plan for data for some other selection of Column A, a lock entry in RSPLSE is shown with the selection but it errors in thelayout with lock on the infoprovider and cannot plan the data.
    Any inputs will be of great help.
    Regards,
    Priyanka

    Post is closed.
    Refer http://scn.sap.com/thread/3564212 for the solution.
    Regards,
    Priyanka

  • Locking Issue in Planning DSO- SAP BW 7.3 Integarted Planning

    Hi Experts,
    We have built Aggregation Level on Direct Update (planning enabled) DSO and used the same in the input ready queries.( Its complete Manual planning - new row addition feature in WAD).
    We have 5 characteristic and one key figure for planning.
    We are facing lock issue while planning the data i.e. when one user is planning, other user cannot plan.
    The lock relevant characteristic is Column A and the same has been added to the Lock Characteristic tab(RSPLSE) of the infoprovider. The input ready query is also restricted with a variable on Column A (manual input single variable- mandatory).
    While the user opens the Planning Layout and plans the data, we can see lock entry in RSPLSE(locks tab) for the Column A selection in the infoprovider, yet if another user is trying to plan for data for some other selection of Column A, a lock entry in RSPLSE is shown with the selection but it errors in thelayout with lock on the infoprovider and cannot plan the data.
    Any inputs will be of great help.
    Regards,
    Priyanka

    Found the answer.
    We had used the Planning Function directly in the WAD layout before saving data without filter.(basically to check some condition).
    Created the Planning Sequence with Column A filter on the Aggregation level and used the same sequence before saving the data in WAD
    Issue resolved.
    Consider this post as closed.
    Regards,
    Priyanka

  • [ADF-11.1.2] Locking issue with SQL 92

    I see one Locking issue with SQL92 Oracle ADF Application.
    ADF Version: [ADF-11.1.2]
    Database: Oracle 10g Express Edition
    Situation 1:
    With Following setting:
    File: Application Resource > Description > ADF META-INF > adf-config.xml
        <startup>
          <amconfig-overrides>
            <config:Database jbo.SQLBuilder="SQL92" jbo.locking.mode="optimistic"/>
          </amconfig-overrides>
        </startup>I have a page showing record 'x' of view object. I open same record on another page. Now I have same record showing on two different tabs of browser.
    1. I modify first record and save it. It worked... Got commited to database.
    2. I goto second tab and modify same record and tried to same it. It throws me an error - Another user has changed the row with primary key oracle.jbo.Key[38 ] . As expected...
    3. I then, reopen the same record on 3rd tab of browser. Modify it and tried to save it. It just hang... as if it is processing the record endlessly.
    If I see the Log:
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [312] BaseSQLBuilderImpl Executing doEntitySelect ... (true)
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [313] Generating new LOCK statement
    <BaseSQLBuilderImpl> <buildSelectString> [314] Built select: 'SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT'
    <BaseSQLBuilderImpl> <doEntitySelectForAltKey> [315] Executing LOCK "SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT WHERE ID=? FOR UPDATE"
    <BaseSQLBuilderImpl> <bindWhereAttrValue> [316] Where binding param 1: 38
    That's it.. nothing happens further.. If I execute above query on SQL Worksheet, it doesn't come up with the result. Just hang for something...
    SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT WHERE ID='38' FOR UPDATE I can execute above query for other record of same table but not '38'. Even if I fire commit command to database, it is not working.
    I have to restart the database services to bring everything to normal state.
    Situation 2:
    With Oracle as Database :
        <startup>
          <amconfig-overrides>
            <config:Database jbo.SQLBuilder="Oracle" jbo.locking.mode="optimistic"/>
          </amconfig-overrides>
        </startup>Everything is working file. i.e. at step 3, record is getting modified successfully with following log:
    <OracleSQLBuilderImpl> <doEntitySelectForAltKey> [27] OracleSQLBuilder Executing doEntitySelect on: ESUSER.CI_AUDIT (true)
    <ADFLogger> <begin> Entity read all attributes
    <OracleSQLBuilderImpl> <buildSelectString> [28] Built select: 'SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT CIAudit'
    <OracleSQLBuilderImpl> <doEntitySelectForAltKey> [29] Executing LOCK...SELECT ID, CI_ID, COLUMN_NAME, DISPLAY_COLUMN_NAME, COLUMN_VALUE, CREATE_DATE, CREATE_BY FROM ESUSER.CI_AUDIT CIAudit WHERE ID=? FOR UPDATE NOWAIT
    <ADFLogger> <addContextData> Entity read all attributes
    <OracleSQLBuilderImpl> <bindWhereAttrValue> [30] Where binding param 1: 38
    <ADFLogger> <addContextData> Entity read all attributes
    <ADFLogger> <end> Entity read all attributes
    <ADFLogger> <end> Lock Entity
    <ADFLogger> <begin> Before posting the entity's changes
    <ADFLogger> <begin> Updating audit columns
    <ADFLogger> <end> Updating audit columns
    <ADFLogger> <end> Before posting the entity's changes
    <OracleSQLBuilderImpl> <doEntityDML> [31] OracleSQLBuilder Executing, Lock 2 DML on: ESUSER.CI_AUDIT (Update)
    <OracleSQLBuilderImpl> <buildUpdateStatement> [32] UPDATE buf CIAudit>#u SQLStmtBufLen: 210, actual=60
    <OracleSQLBuilderImpl> <doEntityDML> [33] UPDATE ESUSER.CI_AUDIT CIAudit SET COLUMN_VALUE=? WHERE ID=?
    <ADFLogger> <begin> Entity DML
    <OracleSQLBuilderImpl> <bindUpdateStatement> [34] Update binding param 1: cip7ri1
    <OracleSQLBuilderImpl> <bindWhereAttrValue> [35] Where binding param 2: 38
    <ADFLogger> <addContextData> Entity DML
    <ADFLogger> <end> Entity DML
    Can any one please tell me, what is the issue with SQL92 setting ?
    Edited by: Anandsagar Sah on Mar 11, 2012 8:10 AM

    The framework works correctly in the Situation #1. Please, note that the locking statement in this case is "SELECT ... FOR UPDATE", but not "SELECT ... FOR UPDATE NOWAIT" (as it is in the Situation #2). When you entered the 2nd tab and tried to update the row, then the framework executed the locking statement and the row was locked (and it remained locked because the framework detected that another user had modified the row, so it stopped the processing and no COMMIT operation was executed). When you entered the 3rd tab and tried to update the row, then the framework tried to lock the row againg, but the locking statement was blocked by the existign lock and it started waiting on the lock from the 2nd tab. So this is expected behaviour.
    The interesting question is why you do not get any error in the Situation #2. In my opinion you should get an error because the locking statement from the 3rd tab should fail immediately (because the row should have been locked from the 2nd tab and the locking statement is with NOWAIT option). I suspect that when the DB is Oracle and you use Oracle SQLBuilder, then the ADF issues a DB savepoint at the beginning of the DML operation and rolls back to the savepoint is a case of some failure, so the 2nd tab has not left any lock. You can check this by setting on SQL trace on the DB server.
    Dimitar

Maybe you are looking for

  • Oracle Forms LAF Problem

    Hi, I've been working on Oracle Forms & the LAF project for the past 1 week. Im totally new to both of them. Constantly, im getting problem in implementing CSS to oracle forms using the LAF project. I downloaded the latest LAF package and followed th

  • How to search for a BADI in a transaction

    Hi All, Please let me know the steps to find a BADI for a transaction. Thanks, Jaffer Ali.S

  • Pixelated images in cover flow after saving in PS

    If I resave any images in Photoshop (without any reduction to file size/resolution), they appear extremely rough (as if they're tiny thumbs) when previewed in coverflow. Images downloaded direct from a camera always open in the Preview application -

  • Add ToolTip to a TextRange?

    Is there a way to add a ToolTip to a TextRange? Thanks!

  • No Quick Poll under Content Management?

    Hi there, just a question. I have Forum Admin rights.. but under Content Management i dont see the Menuentry: Quick Poll?! Did i have to activate first anything? Regards Bjoern