How to lock the rows in program

how to lock the rows in program

Do not create a duplicate thread.
many had already answered your query here.
how to lock the rows in program
Regards,
Prazy

Similar Messages

  • How to lock the rows in a transaction so others cant modify the rows

    Hi,
    I want few suggestion in the following scenario .
    I have a few records ( say 100 ) in a table which Im sending to the client over a network and are populated in a swing GUI...Now the client selects few of them ( say 3 ) and submits to the server. Now the server should assign a number to those rows and store them in the database. As it is a multi client environment While assigning the number it should check that no other client has already assigned a number to at lease to one of the row in the meantime. in that case it shoudl fail.
    In this case i want to lock those 3 records when the request arrives at the server assign number commit and release the lock.
    I want to avoid deadlocks.
    Can any one suggest me whoch locking policy should i use and how ?
    Thanx in advance...
    Mahi

    It depends on how acceptable it is for your commit to fail. By far the easiest and safest thing to do is use Optimistic Locking. This way if the server tries to commit changes to something that has already been committed, an Optmistic Lock exception will be thrown. It's up to your application to handle this, and depending on your domain and the likelyhood of this happeneing, you could just tell the user "try again". The other option is pessemistic locking, which is very, very, dangerous (in my opinion). The main issue is that it's resource intensive, and different databases have different semantics on how it works.
    IIWY, I'd look at Optimistic Locking in the docs and go from there.
    - Don

  • How to print the row  ,column,and particular cell in separate color

    how to print the row  ,column,and particular cell in separate color IN ALV GRID

    HI,
    Here you go good program links
    <a href="http://www.sapfans.com/forums/viewtopic.php?t=52107">How to Set Color to a Cell in AVL</a>
    <a href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm">ALV Grid Coloring</a>
    Thanks
    Mahesh

  • How to make like Encarta encyclopedia and basic screen settings and how to lock the documents in the entire data.

    dear guys how can i make like a off line Encarta encyclopedia and basic screen settings and how to lock the documents in the entire data in visual studio.                 
       thank you. 
                                                              Million
    Getu

    Dave,
    I will +1 Pixelan's products. They are great, simple, and have about the best support that I know of. When you explore, say Pixelan's SpiceMaster, dig deeply. Things appear rather mundane, on the surface, but there is so very much power lurking, just below the surface. I could almost imagine a 1000 page manual to cover every possible aspect of that program... Every time that I use it, I learn something new, and wonderful.
    Good luck,
    Hunt

  • How to lock a row in a db

    Hi,
    Could someone share the code for how to lock the whole database, part of the database or just a row in the database?
    Thanks.

    Whoops... I am sorry about that.
    I am asking about MS Access (version 2002 if that matters)
    Thanks,
    Yaakov.

  • How to lock a row in a db2/400

    Hi all,
    Could someone show me how to lock a row in the database DB2/400
    The scenario:
    DB.beginTransaction
    User 1 gets a row with a column bill_number
    "select bill_number from numbers where pk = xxx for update"
    aux_bill_number = bill_number
    USER 1 updated this row
    "update numbers set bill_number = bill_number +1 where pk = xxx "
    USER 1, like final step, insert aux_bill_number in other table as primary key
    DB.commitTransaction
    While doing so,
    User 2 also gets a row with a bill_number. this user must take bill_number with value 2, but take the same value 1
    This it causes key duplicated in the destiny table.
    Please, help me.
    How I must lock the row not to allow to read until finishing the previous transaction?

    Hi all,
    Could someone show me how to lock a row in the
    database DB2/400Isn't SELECT FOR UPDATE standard?
    >
    The scenario:
    DB.beginTransaction
    er 1 gets a row with a column bill_number
    "select bill_number from numbers where pk =
    xxx for update"
    aux_bill_number = bill_number
    1 updated this row
    "update numbers set bill_number = bill_number
    +1 where pk = xxx "
    USER 1, like final step, insert aux_bill_number in
    other table as primary key
    DB.commitTransactionSounds like you're trying to do something that a JOIN would do better.
    While doing so,
    User 2 also gets a row with a bill_number. this user
    must take bill_number with value 2, but take the
    same value 1
    This it causes key duplicated in the destiny table.
    Please, help me.
    How I must lock the row not to allow to read until
    finishing the previous transaction?Setting the isolation level to SERIALIZABLE might help.
    %

  • How to lock a row by using 'for update'?

    how to lock a row by using 'for update'?

    Hi,
    SELECT * FROM <TABLE> WHERE <PK_COLUMN>=<VALUE> FOR UPDATE NOWAITThis will help in locking the row with the primary key value that you provide
    cheers
    VT

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • Is executeQuery() locking the rows?

    Hi,
    Is executing the following statements lock the rows in database even if myView is a sql_only view? On the other words is executeQuery() locking the rows implicitly?
    myView.setWhereClause(....where clause...);
    myView.executeQuery();
    please advice.Thanks.

    Steven, That's good for me to hear this performance problem is not coming from the executeQuery() method. Let me explain more about this, maybe this is something in application module setting that I am not aware of that.
    I have a jsp page, that gets view object name as a parameter. At the top of this page an application module and the view object instantiated using tags approach. Then the java code reads all the columns from the view using myView.getAttributeDefs() and
    Shows the columns name along with a input box for each( like query page created by wizard). User could define the values in those input boxes. Then the code constructs the WHERE clause based on values entered by user ( and columns name came from the view definition) . at the end when user click on a button( named Find), the page sets the WHERE clause and executes the query and sets the view object based on user defined WHERE clause at runtime ( similar to query page created by wizard).
    Problem:
    Example1 : Pretend client1 clicks the Find button and the page is executing the executeQuery() method. If at this time client2 calls this page, the page loads fast but the columns shows after a delay. this delay is depend on how fast the executeQuery() is. ( this is my understanding, not sure).
    Example2 : Pretend the query takes 2 seconds to be executed when only one client fires that using this page. But takes 10 seconds if two clients at the same time click on the Find button on that page at the same time(after they entered the values on input boxes). And that’s maybe more for three clients.
    On the other words when the executeQuery() is executing for one client, the entire application locks( else where fires the executeQuery() ) for the other clients until the first one released. That’s why I guess ( just guess) this is maybe the behavior of the executeQuery(). Hope this guessing is not true. But what else could be. Is any parameter in application module that need to be altered? Or something on web server (9iAS)?
    Please advice me, even if you are agree or disagree with my guess.
    Thanks for your advice.

  • How to increase the row height of the table in the smartform

    Hi,
    Can any one say,
    How to increase the row height of the table in the smartform.
    It is presently show the row width very small, i want to increase the row with of the table in the smartform.
    Plase say how can we increase the row height in the smartform.

    Hi Ravi,
         In Smartforms , Select the Table and you can adjust the cell hieghts in OUTPUT OPTIONs TAB.
        Reward points if that Helps.
    Manish

  • How to Fix the row in sap script, its urgent......

    Hi Experts,
    first i explain my sap script, i have print void check in my script client give readymade format means box are there, lines are there. i have to fix in box and line data form database table. everthing is working fine. i got all data. i have total 6 window in my script .but i have one issue  In my sap script in header window total five rows... like below
    Check voucher no:8888
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    now sometime check voucher is balnk....
    Check voucher no: BLANK/NULL
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    because of that all rows are move up side and all window also move up side and so script not fix to the box and line all data are seen not perfectly... so guru`s how to fix the row and window in script....
    its urgent...
    Waiting for ur reply
    Thanks & regards
    Jigar

    Hi,
    Follow the below steps . Definately your issue will bve resolved.
    Let us suppose you are printing following fields
    PH &v_text&
    PH &v_text1&
    PH &v_text2&
    you will get the output as you expected.
    and if you have any conditions  for these fileds
    /: if v_text is not initial.
    PH &v_text&
    /: endif
    PH &v_text1&
    PH &v_text2&
    if you have data in each field then you will get output as expected .
    But when v_text is initial.
    the data will be moved up wnhich is happening in your case.
    so what you need to do is?
    /: if v_text is not initial.
    PH &v_text&
    /: else
    PH  (Here you need to mention empty line with same paragraph format
    /: endif.
    PH &v_text1&
    PH &v_text2&
    Reward points if useful
    Regards,
    Nageswar

  • How to lock the Printer of LaserJet Pro 500 Color MFP m570dw

    how to lock the Printer of LaserJet Pro 500 Color MFP m570dw

    You can set a control panel lock security level and password for your HP LaserJet series printer. To lock your printer, follow below link:
    http://h20564.www2.hp.com/hpsc/doc/public/display?​docId=emr_na-bpl03612

  • How to Restrict the Rows In Pivot Table

    Hi All,
    how to Restrict the Row in the Pivot table.
    My Requirement is like this.
    i have to show the top 10 values in the pivot table but My report is show all the values.
    how can we achieve this.
    any quick solution for this appreciated.
    Thanks,
    Yogi.

    Yogi1729 wrote:
    Hi All,
    how to Restrict the Row in the Pivot table.
    My Requirement is like this.
    i have to show the top 10 values in the pivot table but My report is show all the values.
    how can we achieve this.
    any quick solution for this appreciated.
    Thanks,
    Yogi.You can't really restrict the rows in a pivot table, but you can do this:
    http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/

  • How to customize the Java Concurrent Program(PO Output for Communication)

    Hi,
    How to customize the Java Concurrent Program(PO Output for Communication)
    I need to add the Line level Ship To Address ,Line Notes and Extended Price fields on Java Concurrent Program.
    Please any body help/guide me in this regard.

    Hi,
    Changing Java Conc. program for "PO Output for Communication" is difficult.
    Actually, if you observe closely, "PO Output for Communication" program uses PO<HEADER/LINES..>_XML views.
    So if you could change these views and add your requireed columns to it, you can automatically see your changes in XML data file.
    See if the following link will you to get there.. http://chandramatta.blogspot.com/
    thanks,
    Matt

  • How to get the row Count of a ResultSet

    How to get the row Count of a ResultSet

    Hi
    I'v tried rennie1's way ,but I only get zero,my code is:
    rs.executeQuery("select count(*) from t_test");
    if (rs.next()) int rowCount=rs.getInt(1);
    I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
    I tried another way,the code is:
    while rs.next(){
    // Do nothing ,just move the cursour to the last row
    int rowCount=rs.getRow()
    However,the rowCount still equal zero
    Any help would be greatly apprecite!
    note:
    I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle.

Maybe you are looking for