Partial locking for a row

Hello,
For example, I have two queries, the first one just accesses
the first entry of the row. And the second one just accesses the
second entry of the row.
Is there any locking method ? Such that I can lock the first
entry of the row when I use the first query and lock the second
entry of the row when I use the second query. So that I can
speed up the performance of my system in this way.
null

If you're trying to lock on a per-column basis, you won't be able
to, since locks are granular to a per-row basis, not below.
If you want to lock a specific row on a table, you may use a
2-phase commit method like so:
EXEC SQL
SELECT A.ROWID, B.ROWID, <rest of rowid's>, <rest of data>
INTO :blabla, :blabla,.....
FROM TEST_TABLE_1 A, TEST_TABLE_2 B, <rest of tables>
WHERE <where clause w/joins, etc...>
FOR UPDATE;
This will acquire row-locks on all tables referenced, for all
rows fetched by the SELECT.
This lock will be released when you close the current transaction
with a COMMIT or a ROLLBACK (or, if using from within a cursor,
when the cursor is closed if your configuration is set this way).
That means that you would:
1) Acquire the locks on all the rows
2) Do all your work using the ROWID's to locate the rows to query
or manipulate (while they're locked)
3) Commit or rollback
This will allow you to use row-level locks, which increases
concurrency and makes the SQL code a lot faster (because of the
use of rowid's).
I've found that the best method to do this is to use a cursor,
and then work on that cursor's fetches using the ROWID's (NOT the
WHERE CURRENT OF CLAUSE when there is more than one table
involved in the lock mechanism).
Best
Diego
Stephen Lee (guest) wrote:
: Hello,
: For example, I have two queries, the first one just
accesses
: the first entry of the row. And the second one just accesses
the
: second entry of the row.
: Is there any locking method ? Such that I can lock the
first
: entry of the row when I use the first query and lock the second
: entry of the row when I use the second query. So that I can
: speed up the performance of my system in this way.
null

Similar Messages

  • WAD - input locking for selected rows in planning querie!?

    hello guys,
    i need some ideas - in which way i can lock data entry functionality in IP query for selected rows? some rows in the query have an indicator S (sum) and some  I (input). so  i have a chance for selection, which rows are input rows and which rows are sum (dsiplay) rows.
    but all rows are input ready in sap standard querydefiniton and i need some ideas how i could implement an row specific inputfunctionality.
    example
    ITEM                       KEYFIGURE
    line 1   Input           input ready
    line 2   Input           input ready
    line 3   Sline           display only/ no input
    line 4   Input           input ready
    dataslices are no option, because i need to change the "Sline-rows" data via planning functions.
    i need ideas for web, not excel.
    thx for your ideas!
    Edited by: David Jahn on May 4, 2010 2:03 PM

    Hi David,
    of course, it is possible to use two structures in BI-IP, e.g. one containing the key figures (may be restricted) and another one used in the rows where one uses only characteristic values. But then the number of lines in the row structure is static. It is possible to drill-down other characteristics as ususal.
    One idea is to use you characteristic containing the 'S value' as a navigation attribute and to create a row structure containing two lines, one with the restriction # and one with S and the corresponding setting for input readyness (maybe a cell definition for input readyness is needed here). Then drill-down by the base characteristic of the navigation attribute. What is not so nice then that one will get a group change: drill-down characteristic by the row structure; but the system generated characteristic relationship for navigation attributes makes the non existing combinations not input ready.
    Regards,
    Gregor

  • Performance issues; waited too long for a row cache enqueue lock!

    hi Experts,
    OS: Oracle Solaris on SPARC (64-bit)
    DB version:
    SQL> select * from V$VERSION;
    BANNER
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Solaris: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>We have seen 100% CPU usage and high database load, so I checked the instance and have seen there were many blocking sessions and more than 71 sessions running the same select ;
    elect tablespace_name as tbsname from        (select tablespace_name,sum(bytes)/1024/1024 free_mb,0 total_mb,0 max_mb         from dba_free_space         group by tablespace_name         union         select tablespace_name, 0 current_mb,sum(bytes)/1024/1024 total_mb,                sum(decode(maxbytes, 0, bytes, maxbytes))/1024/1024 max_mb         from dba_data_files         group by tablespace_name) group by tablespace_name having round((sum(total_mb)-sum(free_mb))/sum(max_mb)*100) > 95  Blocking sessions are running queries like this;
    SELECT * from MYTABLE WHERE MYCOL=:1 FOR UPDATE;This select queries are coming from a cron job running every 10 minutes to check the tablespaces; so I first killed (kill -9 pid) those select statements so the load and CPU decreased to 13% of CPU usage. Blocking sessions still there and I didn't killed them waiting for app guys confirmation... after few hours and the CPU usage never went down the 13%; I have seen many errors;
    WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=...System State dumped to trace file .....trcAfter that , we decided to restart the DB to release the locks!
    I would like to understand why during loads we were no able to run those select statements, statspack schedule snapshot reports were not able to finish, also automatic
    database statistics... why 5 for update statements locked the whole DB?

    user12035575 wrote:
    SELECT FOR UPDATE will only lock the table row until the transaction is completed.
    "WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK" happens when it needs to acquire a lock on data dictionary. Did you check the trace file associated with the statement?The trace file is too long, which information I need to focus more?

  • Error: WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=26

    Hi every one,
    Today, i met a problem: Application cannot connect to database because database hang ( I also cannot connect to database with sqlplus) . Check alert log, only one error:
    WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=26This error not only appear first time, but also happen every one month. I must reset server for database release all memory but I think It isn't a true solution!
    Could you give a recommend for this.
    Regards.

    The Row Cache is actually the Data Dictionary Cache. It is where definitions from the data dictionary (tablespaces, objects, users etc) are loaded into memory.
    There would be an associated trace file written with the occurrence of this warning.
    See Oracle Support Note 278316.1 for more information
    Hemant K Chitale

  • Animated gif from .ICO files - Indicates layer is partially locked

    thanks for helping the non-graphics newb out...
    trying to create my first animated gif. I have 8 .ico files that i converted to .png to open them. once all are open i try to combine into one file with 8 layers but am unable to do it!?!? If I click on the main layer in any file it shows as locked and says "Indicates layer is partially locked"

    in any file it shows as locked and says "Indicates layer is partially locked"
    That is normal. Just open the file you want to use as the base/background layer. Now open the file that will be the first layer up from that, press ctrl+a (cmd+a on a mac) to select all of it, then ctrl+c (cmd+c) to copy it. Switch back to the background layer, click in it, then press ctrl+v (cmd+v) to paste it and use the move tool to position it. Repeat for each layer. Note that layers in an animated gif do not play in front of hte base layer the way cartoon cels do, so that you see action in front of a backdrop. You must include everything you want to see at once in each layer.

  • Period is locked for new data

    Good Morning,
    Anyone get this error before?
    -4013:Period is locked for new data
       at NetPoint.SynchSBO.SBOObjects.SBOOrder.NetPointToSBOOrder(NPOrder order)
       at NetPoint.SynchSBO.SBOObjects.SBOOrder.NetPointToSBO(NPQueueObject qData)
       at NetPoint.SynchSBO.SynchObjectBase.Synch()
    Haven't received it before today, of course, the day we go live.  The period we are posting to is not locked for new data and it seems to be limited to one customer only...  Any immediate thoughts?
    Thanks so much,
    Kristen

    OK, I have it working for the moment, but I am very curious about this.  I went back in and selected the Install Plugin button 2 more times just to be sure, I restarted everything and they went through fine.  Could it be that the Plugin installed partially before?  It didn't seem so because other orders were flowing both ways and just certain ones were seeming to get stuck...  Then more gradually started failing until none were passing through.  This has been working seemlessly in this environment for weeks until of course go live today, so I am at a loss.  Probably just that one piece of excitement for Go Live that we were missing.  All is well.  James, thanks for responding.

  • Locking a particular row in a table control

    Hi All,
    I have module pool program in which table control is used. I would like to know whether it is possible to lock a particular row in the table so that another person will not be able to edit it until the first user completes his work. It should be only for that particular record which is being currently edited in the table.

    Hi,
      Yes you can lock particular row in a table control..
      In the flow logic..
    PROCESS BEFORE OUTPUT.
      LOOP AT itab INTO wa WITH CONTROL tc.
         MODULE disable_row.
      ENDLOOP.
      MODULE disable_row.
    * call the Enqueue function module..If the
        IF sy-subrc NE 0.
          LOOP AT screen.
               SCREEN-INPUT = 0.    " Disable for input
               MODIFY SCREEN.
          ENDLOOP.
       ENDIF.
      ENDMODULE.
    Thanks
    Naren

  • Is there way to get lock holder by row id?

    My problem is that sometimes some rows get locked for long time and I don't know who holds lock.
    Ideally I want query which takes table_name and primary key value and outputs lock holder information. (e.g sql text, how long query is being running, etc)
    I've found in documentation that there is no central place where row locks are stored and that this is row level metadata.
    My question is: Can I get this row level metadata somehow for concrete row? (I believe this should be possible)
    My usecase would be as follows:
    1. try to get lock for row for id=#N (select for update semantics, actually hibernate is used for that but it shouldn't make difference here)
    2. get error (now i'm getting ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired)
    3. This step is what I want to add. Get information about lock holder for row with id=#N and write it into log file.
    Here is query I was playing with which outputs general information about transactions having locks but it's not what I need in terms of row level locking:
    select a.sql_text, l.ctime, s.STATUS, s.SQL_EXEC_START, s.PROGRAM from
    v$lock l join v$session s on (l.sid = s.sid)
    join v$sqlarea a on (a.hash_value = s.sql_hash_value)
    where l.type='TX' and l.lmode>0;

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version.
    >
    My problem is that sometimes some rows get locked for long time and I don't know who holds lock.
    >
    See this Oracle Magazine article.
    http://www.oracle.com/technetwork/issue-archive/2012/12-jul/o42dba-1566567.html
    >
    You can find the specific row that is locked by first finding the table containing that row. To find that table, use the same V$SESSION view; in this case, the information is in the ROW_WAIT_OBJ# column, which shows the object number of the table whose row is being locked. You can then get the name of the table from the DBA_OBJECTS view, using this object number, as shown in Listing 3.
    >
    For 'who holds the lock' see this thread
    How to check Locking sessions in oracle 10g
    There are many other similar results on the net.

  • Unlocking a "Partially Locked Layer" in Ps CS3

    I am working on a poster for a school project and I have come across something that I have never encountered before in the 4 years of photoshopping I have done. Its a "Partially locked layer". The layer is a text layer and the "lock" button in the layers pallet is off. I have been searching around for how to unlock this layer I have only found these on the "backround" layer not text layers and i cannot figure out ( nor can my teacher(s)) how to unlock it. I need to just transform and edit the text in this layer but am unable to due to the partial locking of the layer.
    Any ideas on how to unlock?
    What I have tried:
    restarting Ps CS3
    Lock Button
    Copying the text layer
    saving as another name and re-opening
    Differnt Computer
    Thanks,
    Matt

    Are either of the 2 icons in red down? If so click on them so they are not depressed.
    If you accidentally used New>> background from layer (your layer would look like the screenshot above). In taht case thje text has been bitmapped, adn even releasing would release this bitmapped.
    If this does not solve your problem, can you post a screenshot of your layers palette?

  • Unlocking a "partially locked" layer

    I have a little "lock" icon in the right side of the layer, next to the fx. Rolling over it tells me the layer is "partially locked". How do I unlock this?

    Hi,
    None of the proposed ways works for me.
    The little lock icons do not repond and the word Lock: is grayed.
    Could it be because it is a .pdf document?
    Doesn't work after I Save As .jpg either.
    Nor if I first save it as .psd.

  • Partially locked layer, but no icon highlighted under 'lock'

    I have not previoulsy experienced this problem. It just started.
    1. I try to use any auto correction such as tone, and nothing appears to change
    2. I see the small layers 'background' icon flashing as I do this into the black and white check pattern
    3. It seems that the layer background is partially locked- (when I scroll my mouse over the 'lock' icon this is written)
    Yet there is no icon above in 'lock' that is highlighted. So I cannot unlock it.
    I am able to adjust in all other methods which are not auto corrections.
    Perhaps I changed some settings accidentally?

    Yes a background layer can not be unlocked for a background layer does not support transparency.  So unlocking its transparency is invalid not an available option.  You must convert the layer to a normal layer that supports transparency. If you want to transform its size, mask it, change its opacity etc..

  • Layer is Partially Locked question?

    I'm using Windows 7 64 bit but I use Photoshop CS5 32 bit.
    In my Layers Panel every file that I open up has that little icon (Indicates Layer is partially Locked).
      A lot of my functions are grayed out because of this condition. If I duplicate the Layer or put a selection around a layer or make a new layer (Layer 0) all previous grayed out functions now work.
    I uninstalled and reinstall PS CS 5 but still had the same problem. Is there something I can do about this condition?
                    Thank you

    I'm not sure if this is your problem, but every time an image is opened for the first time in Photoshop, there is one layer called Background.  This layer is automatically locked.  You can convert the Background layer into a normal (unlocked) layer by double-clicking on the word Background. You are prompted to give the layer another name (default is Layer 0).

  • Will there be a lock on database row?

    Hi,
    I have a stateless session bean with TX_BEAN_MANAGED methods and TX_SERIALIZABLE isolation level. I am not doing a usertransaction.begin() in the method, but i am getting the connections from a datasource. I am not doing any updates/insert/delete as well. It is only read.
    Are the connections that i took associated to any transactions?
    If i do a read on a row from this method, will there be a lock on that row(since isolation level is serializabe) and for how long?
    thanks for your help!
    toby

    I understand that you have set TX_SERIALIZABLE/TX_BEAN_MANAGED/method level.
    If you open a connection in the method and read some rows, those rows will be locked till you exit the method.

  • Table lock ? dictionary row lock? recursive?

    hi guys,
    was looking at dml locks and ddl locks
    for example
    DML changes to table tab
    1) (TX lock for table tab's affected row - stored in the row itself)
    2) (TM lock for table tab - store in V$lock)
    DDL changes to table tab
    1) (DDL lock for table tab -> store in v$lock ?)
    2) (TX lock for dictionary affected row -> locking that row in data dictionary tab to reflect changes)
    3) (TM lock for dictionary tab -> store in V$lock ?)
    (Since i doing a DML to the data dictionary table, am i going to hold another TM lock for that data dictionary table)
    what is a DDL lock exactly?
    1) a lock on the table tab in v$lock
    or
    2) or tx lock on the data dictionary row (which will then incurr a recursive TM lock the data dictionary table)
    or ?
    please advise!

    On behalf of Tanel. :)
    is that TM lock in v$lock view a DDL lock? (tried an alter table command and saw a TM lock appeared)No, TM lock is dml lock as documented. DDL lock(a.k.a, library cache lock) is not exposed via v$lock view. It's exposed only via x$kgllk view.
    so how many locks are actually acquire for e.g when i issue a ALTER TABLE tab xxx ADD col1 NUMBER;You can identify it yourself without big effort.
    alter session set events '10704 trace name context forever, level 10';
    alter table ...;
    alter session set events '10704 trace name context off';==================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    http://dioncho.blogspot.com (japanese)
    ==================================

  • "Partially Locked" background layer = HELP please :)

    Hi there.  I am new to photoshop and still learning daily but am having tons of fun editing & playing   I have PSE11
    I have been editing the same group of pictures for the last few nights and just recently every picture that I bring over from the Organizer has the background layer being "partially locked".
    I have googled it, watched help videos and still can't seem to fix the issue.  I doubled clicked and renamed and still nothing.  With that first layer being "partially locked" I can't seem to do much with the rest of the layers.
    Is there possibly something that I may have hit by mistake?  An easy fix?  Feeling frusterated and hoping to find help......
    Thanks so much

    All background layers always are partially locked. It shouldn't prevent you from doing anything ohter than creating transparent areas. Other editing shouldn't be impeded at all. Double-clicking the layer in the layers panel should bring up a window asking if you want to convert it to a regular layer.

Maybe you are looking for

  • DDIC ACTIVATION error while uploading the patch sapkb70009

    hi when uploading the patch of sap basis in ides , m facing an error of ddic activation and transport error 8 . pls suggest the reasons after this and help me into it . Thx & Regards Shilpa

  • Audiobook chapters get mixed up

    When I download an audiobook to itunes and move it to the audiobooks library, the track numbers (chapters) are all in correct order for each disk and I have selected remember playback position, skip when shuffling, and compilation. When I play the bo

  • Thunderbolt 27 magsafe doesn't fit 13" macbook air

    Why won't the magsafe connector fit the macbook air slot?  It's too large to seat properly.  *** APPLE?  $1000 AND IT DOESN'T FIT???????

  • How to use the http sender adapter

    Hi, I'm trying to use the http sender adapter but not getting the result. 1)  I've created the commnunication channel in Integration Directory. 2)  I have my url: http://<server>:56000/sap/xi/adapter_plain?service=BS&namespace=urn%3Acompany%3Apoc&int

  • Bug in V. 2

    I moved the brightness to the right, then I deleted the history and the brightness still stayed to the right.