How to avoid lock conflict

In the program when a transaction is called first time it is locked then inside that standard SAP function is which is trying to lock the same transaction again.Since it was locked before it is giving out error

>
balaji gautham wrote:
> In the program when a transaction is called first time it is locked then inside that standard SAP function is which is trying to lock the same transaction again.Since it was locked before it is giving out error
Hi ,
You u can avoid the error message by release the lock manually  by doing a direct database update to table TSTC.
The field CINFO holds the value A0 when locked, when unlocked, it holds the value 80 .
Regards ,
Rajesh Kumar

Similar Messages

  • Parallel Device Creation -  How to avoid Locking Issue

    Hi All,
    I am using 'ENQUEUE_EIMASE' and  'DEQUEUE_EIMASE' to lock the MASE table inorder fetch the current serial number for a particular Device Category . Then this serial number is increased by one and FM 'READ_MASE' is used to save the new serial number in MASE database table.
    This works when we are creating just one device at a time for a particular device category.
    But if for the same device category am trying to creat devices parallelly through same program or differrent program, then its not working properly.
    For Eg:
    I am trying to 3 create devices for the same device category simultaneously  through different programs, then only for first one which has obtained the lock on MASE table am obtaining the serial number . And for the other 2 locking of table fails.
    Could you guide me to solve this issue?

    This is not an issue, while the record is being locked by program 1, it cannot be locked by program 2 simultaneously. Thats why we use locking mechanisms. You need to intoduce some time based mechanism like waiting for the first program to complete, or event based method, like keep on trying to lock the record in a loop, untill it gets successfully locked (After the lock is released by program one). Also remember to unlock all the records you lock in your program at the last, though they get unlocked automatically.
    Thanks,
    Saravanan Rajan

  • How to remove locks in BPc netweaver?

    Hi all,
    How to avoid locks and how to remove locks in BPC netweaver and what is meant  by concrete locks and work station locks in bpc netweaver ?
    Thanks
    Pooja

    Hi Pooja,
    There is a good deal of documentation on Work Status and Concurrency Locks in the Application Help.
    I would start there.
    http://help.sap.com
    Cheers, Scott

  • How to avoid 'select for update'

    Hi,
    we are using the bc4j framework of jdev 3.2.3. We have a View which collects data from several tables in different database schemes, so we naturally have to use the 'union clause'. But if we try to make an update on a row (via 'setAttribute'), we got a DMLException ORA-02014 telling us that we should not use 'select for update' on views whith unions.
    Since i cannot avoid using a union clause, is there a way to avoid the 'select for update' in the bc4j framework?
    Please help, its urgent!
    Thanx,
    Dietmar

    SELECT FOR UPDATE is used for our implementation or row-level locking.
    If you are using pessimistic locking mode, this will occur the first time any attribute is modified.
    If you are using optimistic locking mode, it will be deferred until post/commit time.
    If you are using "none" locking mode, it will not happen in your application may hang indefinitely if another session has locked the row.
    Are you asking how to avoid locking?
    Do you mean to be updating this view with a union over multiple databases?

  • How to implement locking in ABAP

    Hello everyone,
        I am doing dialog programming and I have a screen that creates some template. When the user opens up the screen it defualts to next available template number to be created (for example if template No 1 exists then it will default to template no 2 so template 2 will be created). But if multiple users open up the screen then it will show template 2 for both of them and I want to avoid this, i.e. I like to implement some locking mechanism so one user opens up the screen that template is locked and the other cannot create the same template. Please share any ideas and suggestions, how I can imeplement this!
    Thanks.
    Mithun

    Hai  Mithun Dha
    Lock Objects
    The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules (see Function Modules for Lock Requests). These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.
    Structure of a Lock Object
    The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields. When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships (see also Conditions for Foreign Keys).
    Lock Arguments
    The lock argument of a table in the lock object consists of the key fields of the table.
    The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function modules are called, the table rows to be locked or unlocked are specified by defining certain values in these fields. These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked.
    The simplest case of a lock object consists of exactly one table and the lock argument of the table is the primary key of this table. Several tables can also be included in a lock object. A lock request therefore can lock an entire logical object, and not only a record of a table. Such a logical object can be for example a document comprising an entry in a header table and N entries in a position table.
    Locks can also be set from programs in other systems with the corresponding interfaces if the lock object was defined with RFC authorization.
    A lock mode can be assigned for each table in the lock object. This mode defines how other users can access a locked record of the table.
    Table SFLIGHT in the  flight model contains all the scheduled flights of a carrier. Field SEATSMAX contains the number of seats available. Field SEATSOCC contains the number of seats already booked. If a booking is made for a customer (by a travel agency or sales desk), you must check whether there are enough seats available. The number of seats booked is incremented when the booking is made.
    This mechanism must ensure that two sales desks do not make the same booking at the same time and that the flight is not overbooked.
    This can be done by creating lock object ESFLIGHT. Only the table SFLIGHT must be included in this lock object. The flight can then be locked (with the function modules generated from the lock object) when booking. If another sales desk also wants to book seats for this flight, the lock will prevent the flight from being overbooked.
    Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
    The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.
    Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.
    Parameters of the Function Modules
    Field Names of the Lock Object
    The keys to be locked must be passed here.
    A further parameter X_<field> that defines the lock behavior when the initial value is passed exists for every lock field <field>. If the initial value is assigned to <field> and X_<field>, then a generic lock is initialized with respect to <field>. If <field> is assigned the initial value and X_<field> is defined as X, the lock is set with exactly the initial value of <field>.
    Parameters for Passing Locks to the Update Program
    A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case a parameter must check that the lock has been removed.
    Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
    _SCOPE = 1: Locks and lock releases are not passed to the update program. The lock is removed when the transaction is ended.
    _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
    _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
    Parameters for Lock Mode
    A parameter MODE_<TAB> exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. Valid values for this parameter are S (shared), E (exclusive) and X (exclusive but not cumulative).
    The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can however be overridden as required when the function module is called.
    If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_<TAB>.
    Controlling Lock Transmission
    Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:
    Initial value: The lock request or lock release is sent directly to the lock server.
    X : The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.
    Behavior for Lock Conflicts (ENQUEUE only)
    The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
    You have the following options:
    Initial value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
    X : If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
    Controlling Deletion of the Lock Entry (DEQUEUE only)
    The DEQUEUE function module also has the parameter _SYNCHRON.
    If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.
    Exceptions of the ENQUEUE Function Module
    FOREIGN_LOCK: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.
    SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.
    If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.
    Reference Fields for RFC-Enabled Lock Objects
    The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
    Parameters
    Reference fields
    X_<field name>
    DDENQ_LIKE-XPARFLAG
    _WAIT
    DDENQ_LIKE-WAITFLAG
    _SCOPE
    DDENQ_LIKE-SCOPE
    _SYNCHRON
    DDENQ_LIKE-SYNCHRON
    All the tables that can be included in a lock object must be linked with  foreign keys. There are a number of restrictions to the valid relationships.
    The foreign key relationships of the tables of the lock object must form a tree. The tables are the nodes of the tree. The links of the tree mean is the check table of.
    The foreign key fields must be key fields of the foreign key table.
    The foreign key relationships defined between the base tables of the lock objects may not have any field that is checked against more than one other field. A field therefore may not occur twice as foreign key field in a relationship and may not be checked against two different fields in two different foreign key relationships.
    You must keep one restriction in mind for  multi-structured foreign keys. If a field is assigned to a field that is outside the check table, the table containing this field must be in a sub-tree that contains the check table of this foreign key relationship as a root.
    These conditions are always satisfied if the key of the foreign key table is an extension of the key of the check table.
    Conditions 2, 3 and 4 are meaningless if the particular foreign key field was excluded from the assignment to the key fields of the check table by  marking it as generic or setting it to a constant. This is also true for multi-structured foreign keys if the foreign key field refers to a table that is not contained in the lock object.
    Regards.
    Eshwar.

  • HT3228 Please let me know how to avoid receiving the spam into my email accounts on the iPad.  It is very annoying! My server puts it in the spam folder...why do I get it on the iPad?    Is it avoidable and how?

    Please let me know how to avoid receiving the spam (from the spam folder on the server) into my email accounts on the iPad.  It is very annoying!
    My server puts it in a spam folder and I do not receive it in the Ms Outlook on my desk computer...why do I get it on the iPad?    Is it avoidable and how?b

    You actually cannot do anything to your ipad when its locked but look at pictures the time and date, you need to restore it, and if it dosent let you restore, good luck chuck Heres how to restore it: Okay, i only know the itunes way soz, lol. Try to connect your ipad to itunes, if it does let you then you should be able to select the device you have in the corner somewhere, once you do that you should see a screen that looks sort of like your ipads setting, you should have a button that says "Restore" click that and your ipad should be restored. If that dosent work you should try going to your regular office depot or something. Good Luck!

  • How to avoid the dialogue when converting from context menu

    This is a follow-up to http://forums.adobe.com/message/2016146#443364 which was locked due to a bug.
    i would like to know how i can avoid the 'save as' dialogue when using the context menu to convert a word file to pdf using windows XP/acrobat 8/word 2007.
    so far, it always prompts me for the filename, which is annoying as it does not allow me to batch-convert several files and let the thing run its course.
    the solution provided by Steve in the other thread does not work - even if the plugin from word does not propt for a filename, it still does when triggered from explorer/context menu.
    so back to square one: how to avoid that dialogue when not opening word at all?
    cheers, thanks for any help. michael

    For a permanent change, START>PRINTERS>right click on Adobe PDF printer and select properties>General>Printing Preferences>Adobe PDF Settings. Under the settings tab, uncheck the box related to asking for a name. Pretty sure that is the location, but it may vary with version.

  • Hi. My Ipad2 is being reseted each 1 minut of use and then I found this description "resetcounter(date and time).plist". Someone knows what this means and how to avoid this? Many, many thanks. iPad 2

    Hi. My Ipad2 is being reseted each 1 minute of use and then I found this description "resetcounter(date and time).plist". Someone knows what this means and how to avoid this? Many, many thanks.
    iPad 2

    Try resetting your device by holding down both the home and lock buttons for ~10 seconds or until the device restarts, ignoring the power slider. 

  • How to avoid deadlock - ORA-00060 in trigger

    Hi,
    We are using 11.2.0.3 and have a trigger which acts upon a mutex table.
    Trying to catch when value from other program has changed locked value from 0 to 1 to indicate they have finished.
    Once they finished we need to lock the mutex table by updating locked value.
    Code below gives error ORA-00060 - deadlock.
    Any idea how to avoid but allow us to updat ethe mutex table in trigger at star t to say we are locking and at end to indicate we are finished.
    Thanks
    CREATE OR REPLACE TRIGGER example_trg AFTER UPDATE
    ON por_zic_flags
    FOR EACH ROW
    when (NEW.locked = '0' and old.locked = '1')
    declare
    PRAGMA AUTONOMOUS_TRANSACTION;
    I INTEGER;
    v_locked por_zic_flags.locked%type;
    begin
    select locked
    into v_locked
    from por_zic_flags
    --where tabname = ‘table name’
      for update;
    update por_zic_flags set locked = '2';--, guid = '100'; -- unique seq#
    commit;
    -- call procedure do processing on other tables
    -- Now indicate finished processing
    select locked
    into v_locked
    from por_zic_flags
      for update;
    update por_zic_flags set locked = '0';--, guid = '100'; -- unique seq#
    commit;
    end;

    >
    Trying to catch when value from other program has changed locked value from 0 to 1 to indicate they have finished.
    Once they finished we need to lock the mutex table by updating locked value.
    Code below gives error ORA-00060 - deadlock.
    Any idea how to avoid but allow us to updat ethe mutex table in trigger at star t to say we are locking and at end to indicate we are finished.
    >
    Triggers should not be used for non-transactional purposes like this.
    A simple SELECT . . . WHERE (myLock = 'UNLOCKED') FOR UPDATE can be used to query the record and lock it if the lock is not already set. Then your code can update the lock value and that will prevent the same query by other users from being successful.
    But you haven't really provided any information about what you are trying to do.
    If you want to prevent two processes from executing at the same time you can use Oracle's LOCK functionality.
    See this thread for how to use DBMS_LOCK to create your own locks that can serialize access to your procedures.
    Re: possible to lock stored procedure so only one session may run it at a time?

  • HELP. How do I lock a line to a shape so it will auto extend when dragging the shape?

    How do I lock a line to a shape so it will auto extend when dragging the shape? I cant figure out how to turn this feature on and off.

    Edit: JET got there first but I believe your problem is not as complex as he would have you believe :-)
    Complex? What is simpler for the user than being able to connect pre-shaped text frames (not limited to Illustrator's silly Convert To Shape options) with rules, and then be able to move the text frames and have the rules auto-adjust (automatically avoiding other objects, automatically reshaping right-angle bends, etc. etc,) accordingly. What's "complex" about drawing a flowchart?
    One can properly construct a dozen such diagrams in a program that provides proper connector lines in the time it takes to fuss and twiddle with Illustrator for such a simple task. FreeHand, Draw, Canvas, Visio all provide connector lines features.
    The diagramming features in the draw module of Open Office is as good as any of them for the purpose of mundane decision tree diagrams, org charts, and flowcharts; and OpenOffice can be had for free. The same is true of Inkscape. You can download and install either one in less time than it will take to build a single typical such diagram in Illustrator. Using such tools is vastly more intuitive for a beginner than futzing about with Illustrator's "direct selection" routines.
    JET

  • HOw to avoid DeadLocks when you schedule a Sql Server Agent Job and calling SSIS packages

    Hi All,
    I have scheduled 2 packages in in Sql Server Agent jobs .
    First job which is having Package 1 executing at 11 AM and where I am inserting the data in the table.
    Second job which is having Package 2 executing at 12 AM and where I am updating the data in the table based on the first job inserted records.
    When I am executing my first job it taking more time and executing till 12 AM and from 12 AM my job 2 also starting ,so getting deadlocks conflicts because inserting happening from job1 and updating happening from Job 2.
    How to avoid deadlocks and fix the issue.
    Please Suggest .
    Thanks & Regards,
    Anand

    Hi Anand,
    Here is another solution, you can set the Job 2 not to run based on a schedule, and create another SQL Server Agent Job which starts at 12 AM and run with a specified time interval to execute a SQL statement in which you do the following steps:
    1. Get the status information of Job 1 using the statement:
    DECLARE @i int;
    EXEC @i = msdb.dbo.sp_help_job @job_name = ‘Job Name'
    2. If the value of @i is 1 which means the status of job 1 is success and current time is, then start the job 2. So, the statement is as follows:
    IF @I = 1
    EXEC msdb.dbo.sp_start_job @job_name= ‘Job Name’
    Regards,
    Mike Yin
    TechNet Community Support

  • How to create lock object?

    How to create lock object,- by going to se11 i have created but when i am going to sm12 to see wheather the table is locked or not then it is showing no entries found.
    Please help me how to create Lock object and see wheather thetable is lock is locked or not.
    Thnks in advance

    Hi venkateshwar,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    •     Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    •     Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    •     Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    https://forums.sdn.sap.com/click.jspa?searchID=115258&messageID=2656474
    Do the following steps..
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    <b>Reward points if this helps.
    Manish</b>

  • How to see lock in oracle 10g

    hi,
    i m working on an application made in oracle 10g developer, & database is oracle 10g on aix ,
    some times i get some problem when user save any data through forms it gets hanged ,
    so tell me how to get rid of it , when i try to do it from sql navigator i see massges session is busy .
    so y this eror i m getting & how to resolve it.
    thxs

    Here you have some scripts:
    rem
    rem FUNCTION: Report all DB locks
    rem
    column osuser format a15 heading 'User'
    column session_id heading 'SID'
    column mode_held format a20 heading 'Mode|Held'
    column mode_requested format a20 heading 'Mode|Requested'
    column lock_id1 format a10 heading 'Lock|ID1'
    column lock_id2 format a10 heading 'Lock|ID2'
    column type heading 'Type|Lock'
    set feedback off echo off pages 59 lines 131
    start title132 'Report on All Locks'
    spool rep_out\&db\locks
    select nvl(a.osuser,'SYS') osuser,b.session_id,type,
    mode_held,mode_requested,
    lock_id1,lock_id2
    from sys.v_$session a, sys.dba_locks b
    where
    a.sid=b.session_id
    order by 2
    spool off
    pause press enter/return to continue
    clear columns
    set feedback on echo on pages 22 lines 80
    set headingsep ='|'
    set lines 160
    set pagesize 20
    ttitle 'Database Locking Conflict Report'
    btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
    column username      format a10     heading 'User'
    column terminal      format a15     heading 'Application|PC'
    column object           format a15     heading     'Table'
    column sql            format a15     heading 'SQL'
    column sid           format 999     heading 'SID'
    column lock_type      format a15     heading 'Lock|Type'
    column mode_held      format a11     heading 'Mode|Held'
    column mode_requested      format a10     heading 'Mode|Request'
    column lock_id1      format a8     heading 'Lock ID1'
    column lock_id2      format a8     heading 'Lock ID2'
    column first_load_time  format a19     heading 'Requested'
    break on lock_id1
    select a.sid,
           username,
           terminal,
           decode(a.type,'MR', 'Media Recovery',
                      'RT', 'Redo Thread',
                   'UN', 'User Name',
                   'TX', 'Transaction',
                   'TM', 'DML',
                   'UL', 'PL/SQL User Lock',
                   'DX', 'Distributed Xaction',
                     'CF', 'Control File',
                   'IS', 'Instance State',
                   'FS', 'File Set',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'TS', 'Temp Segment',
                   'IV', 'Library Cache Invalidation',
                   'LS', 'Log Start or Switch',
                   'RW', 'Row Wait',
                   'SQ', 'Sequence Number',
                   'TE', 'Extend Table',
                   'TT', 'Temp Table', a.type) lock_type,
            decode(a.lmode,0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.lmode)) mode_held,
       decode(a.request,
       0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.request)) mode_requested,
       to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
       c.object object,
       d.sql_text sql,
       e.first_load_time
    from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
       where (id1,id2) in
         (select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
         b.id2=a.id2 and b.request>0) and
         a.sid = v$session.sid and
         a.sid = c.sid and
         d.address = v$session.sql_address and
         d.hash_value = v$session.sql_hash_value and
         d.address = e.address
    order by a.id1, a.lmode desc
    set headingsep ='|'
    set lines 160
    set pagesize 20
    ttitle 'Database Locking Conflict Report'
    btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
    column username      format a10     heading 'User'
    column terminal      format a15     heading 'Application|PC'
    column object           format a15     heading     'Table'
    column sql            format a15     heading 'SQL'
    column sid           format 999     heading 'SID'
    column lock_type      format a15     heading 'Lock|Type'
    column mode_held      format a11     heading 'Mode|Held'
    column mode_requested      format a10     heading 'Mode|Request'
    column lock_id1      format a8     heading 'Lock ID1'
    column lock_id2      format a8     heading 'Lock ID2'
    column first_load_time  format a19     heading 'Requested'
    break on lock_id1
    select a.sid,
           username,
           terminal,
           decode(a.type,'MR', 'Media Recovery',
                      'RT', 'Redo Thread',
                   'UN', 'User Name',
                   'TX', 'Transaction',
                   'TM', 'DML',
                   'UL', 'PL/SQL User Lock',
                   'DX', 'Distributed Xaction',
                     'CF', 'Control File',
                   'IS', 'Instance State',
                   'FS', 'File Set',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'IR', 'Instance Recovery',
                   'ST', 'Disk Space Transaction',
                   'TS', 'Temp Segment',
                   'IV', 'Library Cache Invalidation',
                   'LS', 'Log Start or Switch',
                   'RW', 'Row Wait',
                   'SQ', 'Sequence Number',
                   'TE', 'Extend Table',
                   'TT', 'Temp Table', a.type) lock_type,
            decode(a.lmode,0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.lmode)) mode_held,
       decode(a.request,
       0, 'None',           /* Mon Lock equivalent */
       1, 'Null',           /* N */
       2, 'Row-S (SS)',     /* L */
       3, 'Row-X (SX)',     /* R */
       4, 'Share',          /* S */
       5, 'S/Row-X (SSX)',  /* C */
       6, 'Exclusive',      /* X */
       to_char(a.request)) mode_requested,
       to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
       c.object object,
       d.sql_text sql,
       e.first_load_time
    from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
       where (id1,id2) in
         (select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
         b.id2=a.id2 and b.request>0) and
         a.sid = v$session.sid and
         a.sid = c.sid and
         d.address = v$session.sql_address and
         d.hash_value = v$session.sql_hash_value and
         d.address = e.address
    order by a.id1, a.lmode descCheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • How to avoid the objects dependency in the packages by standard settings?

    Hi,
    How to avoid the objects dependency in the packages by standard settings?
    Example Scenario -> Our project uses two packages u2018ZZP1u2019 and u2018ZZP2u2019 for developments in the system u2018SN1u2019. We created a domain u2018ZZ_DO_TESTu2019 in the Package u2018ZZP1u2019. Now we have to make sure that the developer should not use or refer domain u2018ZZ_DO_TESTu2019 for the developments in the package u2018ZZP2u2019.
    u2026Naddy

    Evevn i felt that in the CTS at least a warning can be given if the included objects refer to any other object(s) which arre:
      1. Local Objects
      2. Locked under other requests,
      3. Lastly able to detect cyclic dependency as in we had a situation where we had a program locked in request A which calls an FM locked in request B. Now Request B refers to a message which is locked in request A.Since it was a message it gave only requrn code 4 in transport and transport ended with warnings. But if it is some other object then it is going to give compile error in at least one transport and neither can be moved without the other.
    Anyways, i will check the BAPI he has mentioned and see if any workaround can be done,
    Request: Please keep the post active until we arrive at a good solution,Thanks.

  • Lock conflicts

    I'm quite a newbie when it comes to using Berkeley DB. I am using BDB
    dbxml.
    I have an application that fetches data from an external source and
    writes that into dbxml. The data fetch takes a long time, so I start a
    new thread to do this. All writes into dbxml for that batch are then
    done in that same new thread.
    When I have a few batches running at the same time, after variable
    amounts of time, the application will hang. When this happens my only
    option is to run db_recover.
    The problem happens when I have more than one of these: multiple writes
    in multiple threads. I am protecting everything with transactions, but
    am getting lock conflicts.
    The output of db_stat -CA includes this:
    1 Total number of locks not immediately available due to
    conflicts
    80000275 READ 28 HELD RefData page
    3105
    80000275 WRITE 55 HELD RefData page
    3105
    80000276 READ 1 WAIT RefData page
    3105
    Unfortunately, I don't know how to interpret this. How do I tell where
    the conflict is happening? What sort of pattern should I be following
    to prevent this from happening?
    I don't know what information would help make the above clearer, but am happy to provide more.
    Many thanks,
    PC

    After reading some more of the manual, I see the following paragraph:
    "This has important implications. If a single thread of control opens two cursors, uses a combination of cursor and non-cursor operations, or begins two separate transactions, the operations are performed on behalf of different lockers. Conflicts that arise between these different lockers may not cause actual deadlocks, but can, in fact, permanently block the thread of control. For example, assume that an application creates a cursor and uses it to read record A. Now, assume a second cursor is opened, and the application attempts to write record A using the second cursor. Unfortunately, the first cursor has a read lock, so the second cursor cannot obtain its write lock. However, that read lock is held by the same thread of control, so the read lock can never be released if we block waiting for the write lock. This might appear to be a deadlock from the application's perspective, but Berkeley DB cannot identify it as such because it has no knowledge of which lockers belong to which threads of control. For this reason, application designers are encouraged to close cursors as soon as they are done with them."
    I am wondering if this is what is happening as db_deadlock is not returning anything.
    In dbxml, how is a cursor created?
    In order to make modifications to nodes, first I have to select those nodes. I then have to modify those nodes. Presumably, a select will create a read lock, and a modify will then create a write lock? In my application i have a function "setValues" that does this- first select nodes, then modify the selected nodes in some way. I am wondering if two instances of setValues in separate threads are causing the problem.
    I see that I have a read lock waiting on a write lock. How do I tell which reads and writes these are happening on?
    Thanks,
    PC

Maybe you are looking for