Custom Scenario requiring table Lock - Please Suggest

Hi ,
Custom usecase :
There exist a table with following column :
FileName, LastUpdatedBy, ApprovedBy, DisapprovedBy, LogicallyDeleted, FileDescription, Col2
Primary Key - ( FileName, LastUpdatedBy,ApprovedBy)
Constraint : FileName,lastUpdatedBy,ApprovedBy cannot be null. Default values for LastUpdatedBy, ApprovedBy, DisapprovedBy is NONE, and LogicallyDeleted is N.
Note : User should not be allowed to create more that two records for same fileName.
Edit functionality required on UI : On editing a record, a copy of the row should be created with same fileName , LastUpdatedBy with userId of logged in User.
How should I restrict user from doing the following :
Two users open the UI. Selected same record to edit. At time of commit only record for one should get commited, while for other it should not happen as 2 records gets created for same file name as soon as commit is done for one user.
Do i need to have table lock, then count row with a particular file name and if count >2 then commit else throw some exception. And if this is needs to be done than which method should be overridden to do that.
Thanks,
Rajdeep

Hi
To Shay : ( You can define a new method validation at the entity level to do the check for you. http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcvalidation.htm#CACGFEDC )
From my post : - Where should that logic can be implemented in ADF BC and what logic ( anything different from what I mentioned in post ) ?
If I am going to write validation in custom method at entity level, I think it is not handling the scenario properly. For example : Query for Count on fileName records is fired in validator method for two entities before the commit is happening for any of the two.
Also What logic : do you agree with table lock logic requirement here ?
To Santosh,
I think you didn't got the scenario. It does not talk about two user doing normal edit on same record. Notice two facts mentioned in post :
1. When a user selects a record to edit... he is not actually editing it. We create a copy of the row ( with FileName , LastUpdatedBy,ApprovedBy,LogicallyDeleted as readOnly and prepopulated with sameFileName as original record, UserId in LastUpdatedBy, NONE defaults for Approved by and Disapproved By , N default for LogicallyDeleted) launched in popup. Popup has two buttons ... save and cancel. On cancel we rollback transaction ( i.e. deletes the newly created copy ) and Save ... eventually commits the row.
2. Not more two records should get created in table for same fileName. So two users trying to edit same record will eventually try to create the 3 records in database table. It should fail for 3rd one...
What logic should be written ... Does it really need the table lock ? Etc
Thanks,
Rajdeep

Similar Messages

  • How to read data from flatfile and insert into other relevant tables ? Please suggest me the query ?

    Hi to all,
    I have flat files in different location through FTP i need to fetch those files and load in the relavant table of the database.
    Please share me the query to do it ..

    You would need a ForEach Loop to iterate though the files. Initially the FTP task will pull the files from locations to a landing folder. Once thats done the ForEachLoop will iterate through files in the folder and will have a data flow task inside to transfer
    file data to tables.
    If you want a more secure option you can also use SFTP (Secured FTP) and can implement it using free WinSCP clinet. I've explained a method of doing it fo dynamic files here
    http://visakhm.blogspot.in/2012/12/implementing-dynamic-secure-ftp-process.html
    for iterating through files see this example
    http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
    you may not need the validation step inside the loop in your case
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Cisco Unity 7 Problem in Message Store Wiard. Showing some SRV Records Missing in DNS Table. Please suggest and help on this matter.

    Installed Cisco Unity 7 on Windows Server 2000 and Unity Server is on Domain,and Exchange we are using is Exhcnage 2007. When we reach at Message Store Wizard it is showing some error at the end that " Failed reaching for Unity in Active Directory Global Catalog. The SVR Record may be missing in DNS Table" . It shows when we slected Exchange in Process and the Selected Storage Group. And the it takes time and then shows error. Please try to resolve this issue soon, we need this solution urgently. We have already spent several days on different issues regarding Unity.
    If you need to talk regarding this matter, Please contact on +919780660619, and the conatct person name is Manav.
    Thanks in Advance
    Rosy

    Rosy,
    We cannot call you from this forum. If you truly need a call, you can open a TAC case. The info I can tell you is that you need to fix this in your dns. A simple google search of "no SRV record Windows 2000 server" comes up with numerous resources that can help you fix this. Here is just one example.
    http://support.microsoft.com/kb/241505
    and
    http://www.petri.co.il/active_directory_srv_records.htm
    I would also advise you, if you are doing a new install with Unity 7 and that version of Exchange, that you use Windows 2003 as the OS. Even MS doesn't support Windows 2000 Server any more so if you end up having an OS issue on your Unity server, we will not be able to get MS to help you. From a support perspective, I would advise you to use Windows 2003 Server in this implimentation.
    Thanks!
    Tray

  • Hierarchy table Query..suggestions plz.

    Experts,
    Find my query below for extracting the level 8 elements from a hierarchy table.
    Please suggest a better SQL Query,if there could be one.
    SELECT DSEND_ID
    FROM PROD WHERE DSEND_LVL=8
    AND PARNT_ID IN
    (SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=7
    AND PARNT_ID IN
    (SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=6
    AND PARNT_ID IN
    (SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=5
    AND PARNT_ID IN
    (SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=4
    AND PARNT_ID IN
    (SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=3 AND PARNT_ID='000000080')))))
    ORDER BY DSEND_IDThanks,
    Bhagat

    PARNT_ID        DSEND_ID         DSEND_LVL      PARNT_LVL
    000000000       000000000                1          1
    PARNT_ID        DSEND_ID         DSEND_LVL   PARNT_LVL
    000000000       000000002                2          1
    000000002       000000002                2          2
    000000000       000000003                2          1
    000000003       000000003                2          2
    000000000       000000004                2          1
    000000004       000000004                2          2
    000000000       000000005                2          1
    000000005       000000005                2          2
    000000000       000000009                2          1
    000000009       000000009                2          2
    000000000       000000010                2          1
    000000010       000000010                2          2
    000000000       000000011                2          1
    000000011       000000011                2          2
    000000000       000000001                2          1
    000000001       000000001                2          2
    000000000       000000006                2          1
    000000006       000000006                2          2
    000000000       000000008                2          1
    000000008       000000008                2          2
    [\pre]
    This is how the table data looks...I've put the level 1 and level 2 elements alone..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Have Multiple entries in Fnd_nodes..Please suggest

    Hi,
    I have multiple entries in the production fnd_nodes table. Please suggest if its ok to have below mentioned entries. Please suggest the possible steps if we need to clean it up.
    The environment is single instance and on 11.5.10.2 on IBM AIX OS.
    From FND_NODES
    Node_name     Description
    ==========================================
    <ProdInst_Name>     (null)     
    AUTHENTICATION     Authentication Value     
    Thanks a lot for the help.
    Hari

    The reason I was ambiguous about these entries is, our Test,QA,Dev instances fnd_nodes table have these 2 entries (mentioned above in this thread) plus their respective Instance entries. This raised a doubt, do we need to have only 1 entry i.e. entry of the respective instance in this table or is it OK to have other values like AUTHENTICATION, other instance information in this table.You should have more than one entry in this table, one for AUTHENTICATION and one for each database/application tier node.
    Also, I see continuous error messages in Prod concurrent manager log as indicated below. I Read in one of the articles to check for fnd_nodes having multiple entires might be a reason for below error messages. Thats why I wanted to check with you all, to see if there is any thing needs to be done to avoid future issues. BTW,The instance is working great...Just that I am concerned with CMLog having these error messages populating all the time...
    Would highly appreciate your helpTo make sure you have proper entries, please purge FND_NODES table and run AutoConfig on each tier node.
    How to get a clean Autoconfig Environment ? [ID 391406.1]
    How to Clean Nonexistent Nodes or IP Addresses From FND_NODES [ID 260887.1]
    CM Log sample error message info
    ===========================
    Process monitor session started : 10-JUN-2012 07:28:52
    CONC-SM TNS FAIL
    Call to PingProcess failed for FNDOPP
    CONC-SM TNS FAIL
    Call to StopProcess failed for FNDOPP
    Process monitor session ended : 10-JUN-2012 07:28:54
    ================================Those errors are related to OPP -- Please see these docs.
    Concurrent Processing - ICM log file shows 'CONC-SM TNS FAIL', 'Call to PingProcess failed', and/or 'Call to StopProcess failed' for FNDCPGSC/FNDOPP [ID 1312632.1]
    Mails are not Received Using Delivery Option while Submitting Concurrent Request In R12.1.3 [ID 1339491.1]
    Thanks,
    Hussein

  • Could you please suggest me the scenario for this requirement ?

    In module booking process we need the following process
    1.Student select their interested event package via website.
    2.Advisor review the student's event package list.
           2.1 In case of REJECT : student need to revise their list
           2.2 In case of APPROVE : all event package have confirm and run fee calculation.
    The information above is shortly requirement , if any one have suggestion for this requirement please suggest me.

    Vorad,
    I have some suggestions for you:
    1.  Create the module/event booking with 'Manual Conditional' flag.  Then, when the advisor approves a booking, remove the conditional flag.  If the advisor rejects, cancel the booking.  Here, you need to create some kind of UI for the advisor to review and approve/reject the requests.
    OR
    2.  Create the booking using a booking status such as 'pre-booked'.
    OR
    3.  Don't create any bookings from the student side.  Just create a booking plan instead.
    OR
    4. Look at a subtle process change that would let you use more out-of-the-box user interfaces/processes.  Students simply request special booking authorization for the event packages they want.  This automatically sends workflow approval messages to the advisor.  Then, just have a general rule which blocks all bookings that don't have this special authorization.   Once the student has a special booking authorization, he can just go into the course registration self-service and book the approved event packages.
    Michael

  • Custom Color  required to table control in Standard transaction

    Hi Expers,
    I required to populate a table control row with custom color/s.  The table control is belongs to SAP Standard transaction MF50.
    Can you please suggest.
    Thanks,
    Prasad

    Hello Madhu,
    As indicated by u have have asked for the access key and have added a field. Where have u added this field. Secondly in which table are u going to update this material field once it starts getting displayed. Also have u put in code in ur PBO and PAI for the same. Please respond to the questions so that we can provide u with better option.

  • Hi all, Please suggest a case where there is a requirement for new SOAP sender adapter module. I wanted to develop a module but in my current project i am unable to find any such requirement.

    Hi all, Please suggest a case where there is a requirement for new SOAP sender adapter module. I wanted to develop a module but in my current project i am unable to find any such requirement. So please give me inputs for the same..
    Thank you,
    Vinay Kumar A

    You can try converting a synchrnous soap call to asynchronous using a custom module
    Here your module will send a response back to the sender system and make an asynchronous call forward

  • Best table lock suggested ??

    hi,
    i have a scenario as follows:
    i am developing a custom transaction, dialog based, basically to perform add/modify/delete data from custom tables. Multiple users can login and try to work on the data, one can add records to the same table and another can modify teh records of the same table. So whats the best kind of table lock to be used ? and how to hande that ?
    thks

    Hi,
    For Locking look at the below code
      DATA: l_v_locktab   TYPE tabname,
            l_v_funcname  TYPE rs38l_fnam,
            l_v_noobj     TYPE flag,
            l_v_garg      TYPE eqegraarg,
            l_i_enq       TYPE STANDARD TABLE OF seqg3.
      IF rb_upd = space.
        EXIT.
      ENDIF.
      l_v_locktab = fp_table.
      CASE l_v_locktab.
        WHEN 'LIPS'.
          l_v_locktab = 'LIKP'.
        WHEN 'VBAP'.
          l_v_locktab = 'VBAK'.
        WHEN 'VBRP'.
          l_v_locktab = 'VBRK'.
        WHEN 'PLPO'.
          l_v_locktab = 'PLKO'.
      ENDCASE.
    * Search Lock objects for the table
      SELECT viewname FROM dd25l INTO v_lockobj
             UP TO 1 ROWS
             WHERE aggtype = 'E'
             AND   roottab = l_v_locktab.
      ENDSELECT.
      IF sy-subrc = 0.
        CONCATENATE 'ENQUEUE_' v_lockobj INTO l_v_funcname.
    *   Check if the  Enqueue function is OK
        SELECT SINGLE funcname FROM tfdir INTO l_v_funcname
                      WHERE funcname = l_v_funcname.
        IF sy-subrc = 0.
          CALL FUNCTION l_v_funcname
    *       EXPORTING
    *         MANDT                = SY-MANDT
    *         _SCOPE               = '2'
    *         _WAIT                = ' '
    *         _COLLECT             = ' '
           EXCEPTIONS
             foreign_lock         = 1
             system_failure       = 2
             OTHERS               = 3
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            LEAVE LIST-PROCESSING.
          ENDIF.
        ELSE.
          CLEAR v_lockobj.
          l_v_noobj = 'X'.
        ENDIF.
      ELSE.
        CLEAR v_lockobj.
        l_v_noobj = 'X'.
      ENDIF.
    *   If No lock object is found for the table, do a general check.
    *   Read Locks
      IF l_v_noobj = 'X'.
        CALL FUNCTION 'ENQUEUE_READ'
         EXPORTING
            gname                       = fp_table
    *       GARG                        = ' '
            guname                      = space
    *       LOCAL                       = ' '
    *     IMPORTING
    *       NUMBER                      =
    *       SUBRC                       =
          TABLES
            enq                         = l_i_enq
         EXCEPTIONS
           communication_failure       = 1
           system_failure              = 2
           OTHERS                      = 3
        IF l_i_enq[] IS NOT INITIAL.
          MESSAGE i023.
          LEAVE LIST-PROCESSING.
        ELSE.
          CONCATENATE fp_table '*' INTO l_v_garg.
          CALL FUNCTION 'ENQUEUE_READ'
           EXPORTING
              gname                       = 'RSTABLE'
              garg                        = l_v_garg
              guname                      = space
    *         LOCAL                       = ' '
    *       IMPORTING
    *         NUMBER                      =
    *         SUBRC                       =
            TABLES
              enq                         = l_i_enq
           EXCEPTIONS
             communication_failure       = 1
             system_failure              = 2
             OTHERS                      = 3.
          IF l_i_enq[] IS NOT INITIAL.
            MESSAGE i023.
            LEAVE LIST-PROCESSING.
          ENDIF.
        ENDIF.
    * if No Lock exists. Do a common lock
        CALL FUNCTION 'ENQUEUE_E_TABLE'
         EXPORTING
    *      MODE_RSTABLE         = 'E'
           tabname              = fp_table
    *      VARKEY               =
    *      X_TABNAME            = ' '
    *      X_VARKEY             = ' '
    *      _SCOPE               = '2'
    *      _WAIT                = ' '
    *      _COLLECT             = ' '
         EXCEPTIONS
           foreign_lock         = 1
           system_failure       = 2
           OTHERS               = 3
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    for unlocking
      DATA: l_v_funcname  TYPE rs38l_fnam.
      IF v_lockobj NE space.
    *   if Lock Object is available
        CONCATENATE 'DEQUEUE_' v_lockobj INTO l_v_funcname.
    *   Check if the  Dequeue function is OK
        SELECT SINGLE funcname FROM tfdir INTO l_v_funcname
                      WHERE funcname = l_v_funcname.
        IF sy-subrc = 0.
          CALL FUNCTION l_v_funcname.
        ENDIF.
      ELSE.
    *  Do a common Unlock
        CALL FUNCTION 'DEQUEUE_E_TABLE'
         EXPORTING
    *     MODE_RSTABLE       = 'E'
          tabname            = fp_table
    *     VARKEY             =
    *     X_TABNAME          = ' '
    *     X_VARKEY           = ' '
    *     _SCOPE             = '3'
    *     _SYNCHRON          = ' '
    *     _COLLECT           = ' '
      ENDIF.
    Shreekant

  • Please suggest me good links for locking mechanism in SAP

    Please suggest me good links for locking mechanism in SAP
    thanks,

    Hi Akash,
    Here is a small description on lock object.
    The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the lock table of the system for each table.
    Access by more than one user can be synchronized in the following ways:
    Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
    Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
    Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
    Check out this thread:
    LOCK OBJECT?
    Regards,
    Vivek
    PS: Award points if helpful

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • Hi, i am using SAP by Design in india. I am trying to get GL entry report in which i require a field "Approved by" but unable to find - please suggest.

    Hi, i am using SAP by Design in india. I am trying to get GL entry report in which i require a field "Approved by" but unable to find - please suggest.

    Hi hanmant,
    You could find GL Line item report under General ledger WOC => Reports => List=> G/L Line Item Report, but this report does not have filter parameter "Approved by".
    May I know what was the use case behind "Approved by" field?
    BR, Rakesh

  • I had my iphone from France and now days I am in India. Can anyone please suggest how i can unlock its country lock to operate it using Indian carriers.

    I had my iphone from France and now days I am in India. Can anyone please suggest me, how i can unlock its country lock to operate it using Indian carriers.

    Only the carrier your phone was locked to in France can authorize the official unlocking of your phone. So contact them as to cost/procedure.

  • Modular or New Custom Component Approach : Please suggest

    Hi ,
    I am developing a Flex Application which will used within the organization of Employees
    Please suggest me , as what to approach to follow to develop this :
    After an user (Employee) of an Organization logins , he can be allowed to do various operations
    depending upon various modules .
    Should i develop each of these things using Flex Modules  approach or normal New Component ??
    please suggest an approach

    @kiran7881,
    If your each module is individually large in size and involves lot of code and stuff and if number of such modules are more then you can go with modules concept.
    Otherwise if your stuff involves simple and small operations to perform then you can go with creating normal Components approach.
    Thanks,
    Bhasker

  • Relationship between tables..Please.

    Hi SRM folks,
      I am working on EBD-SAP BW project, I have problem of primary key please look at my scenario.
    I have a view( ZBW_SHOPCART : View for extracting Shopping Cart data to BW),
    in turn the view is built on the following tables:
    1)  CRMD_ORDERADM_H : Business Transactions CRM                                                       
    2)  CRMD_ORDERADM_I  : Business Transaction Item                                                      
    3)  BBP_PDBEI  :  Backend Specific Item Data                                                                  
    4)  CRM_JEST   :  Individual Status per Object
    common primary key is GUID and MANDT
    According to the current  Requirements 
    We need to Enhance the view ZBW_SHOPCART  with the following table fields
    Step Name : Table   SWWWIHEAD : Workflow Runtime: Header Table for All Work Item Types
                              Field     WI_TEXT
    Status          :   Table   SWWWIHEAD
                              Field    WI STAT
    Results       : Table SWDSTEXT : Workflow definition: Language-dependent texts
                           Field WFD_TEXT
    Date            :   Table   SWWWIHEAD
                             Field    WI_CD
    Time          : Table   SWWWIHEAD
                          Field   WI_CT
    Agent       :   Table   SWWWIHEAD
                         Field   WI_AAGENT
    Problem :  There is no common( Primary key ) key between the tables SWWWIHEAD,  SWDSTEXT and the View ZBW_SHOPCART to join the tables with the View.
    Folks please suggest me in this regard, are there any ways to join the tables SWWWIHEAD and  SWDSTEXT with the view
    I will wait for your valuable suggestion,
    thank you
    DJ

    Hi,
    Currently we are extracting the data from EBP to SAP BW based on the view
    <b>ZBW_SHOPCART : View for extracting Shopping Cart data to BW</b>
    is containing the tables & fields as follows
    Tables:
            CRMD_ORDERADM_H
            CRMD_ORDERADM_I
             BBP_PDBEI
             CRM_JEST
    Field                Table
    CLIENT              -CRMD_ORDERADM_H
    HEADER_GUID      -CRMD_ORDERADM_H
    OBJECT_ID      -CRMD_ORDERADM_H
    ITEM_GUID      -CRMD_ORDERADM_I
    STAT              -CRM_JEST
    INACT              -CRM_JEST
    CHGNR              -CRM_JEST
    DESCRIPTION      -CRMD_ORDERADM_H
    CREATED_AT      -CRMD_ORDERADM_H
    BE_OBJECT_ID      -BBP_PDBEI
    CHANGED_AT      -CRMD_ORDERADM_H
    now Current requirement is to enhance that view with some more fields as follows
    Step Name : Table   SWWWIHEAD : Workflow Runtime: Header Table for All Work Item Types
                              Field     WI_TEXT
    Status          :   Table   SWWWIHEAD
                              Field    WI STAT
    Results       : Table SWDSTEXT : Workflow definition: Language-dependent texts
                           Field WFD_TEXT
    Date            :   Table   SWWWIHEAD
                             Field    WI_CD
    Time          : Table   SWWWIHEAD
                          Field   WI_CT
    Agent       :   Table   SWWWIHEAD
                         Field   WI_AAGENT
    I need to join this fields into the view, am not able to see the common( Primary key ) key.
    Please help me
    Message was edited by:
            Jangareddy dasari
    Message was edited by:
            Jangareddy dasari
    Message was edited by:
            Jangareddy dasari

Maybe you are looking for

  • MacBook Pro Display Issue

    I have a macbook pro since April, 2012, So far I had no issues. However, today the screen has turned blueish and pixelated. I could still use it without any issues however, the display seems to be still there. I have tried restart and Command + Optio

  • Bug when encoding f4v videos longer than ~ 1 hour ?

    Folks, We're getting a strange problem with Adobe Media Encoder. We encode a long (slightly more than 1 hour) f4v video and Adobe Media Encoder reports that the file encoded successfully with no errors. But when we scrub through the video (i.e., move

  • Request groups to responsibility mapping

    Hi I have used the following query to get list of programs mapped to request group and responsibility combination. I feel that i may be missing some programs. Do you have an idea of what does request_unit_type = 'P' stand for and what could be other

  • Error relationship one to many

    I'm having a problem using JPA (toplink) / Jaybird with a relationship for many: Call the methods: EmpresaFacadeRemote empresa = (EmpresaFacadeRemote) ic.lookup("br.teste.app.beans.EmpresaFacadeRemote"); empresa.createEmpresa(jtfRasaoSocial.getText()

  • Appstore :time out van het verzoek

    Wanneer ik in de appstore een app wil zoeken krijg ik: time out van het verzoek weet iemand wat er aan de hand is?