Few lock table questions ...

I have an app with Java + Oracle. I have a few tables which can be modified ( select, insert, up, del) by more than one user.
For ex
//---------- get info from database
SELECT a FROM A;
// later
SELECT b FROM B;
// --------- end
Q1). how can I make sure that after I select from A, no one modifies table B, until I select from B ?
Q2). If I have 3 tables and I have to insert some values, in all of them, how should I do this ? ( lock tables, put the insert * 3 into an transaction, release locks)
Q3). I know that jdbc-odbc isn't very good, but still, can I use it ?

Q1). how can I make sure that after I select from A,
no one modifies table B, until I select from B ?No one modifies table B in any way at all? While the user goes for a coffee break? Why would you want that?
Q2). If I have 3 tables and I have to insert some
values, in all of them, how should I do this ? ( lock
tables, put the insert * 3 into an transaction,
release locks)Just insert the records. You can put the three inserts in a transaction, if you need that, but there's no point in preventing other users from accessing the tables while you do that.
Database applications that use Oracle or other databases designed for large numbers of users rarely lock tables. If your design leads you into a place where you have to lock tables then you probably need to go back and fix your design so that it supports multiple users in a normal way.
Q3). I know that jdbc-odbc isn't very good, but
still, can I use it ?Sure. But Oracle comes with its own JDBC drivers so you don't need to.

Similar Messages

  • IDOC Receiver Adapter, getting Lock Table Overflow to CRM System

    Hello SDN!!!
    This scenario is for PI to process a file and send to CRM via IDOC. The IDOCu2019s are only being created and not processed until later.
    Problem: I am getting a Lock Table Overflow error in method IDOC_INBOUND_ASYNCHRONOUS via sm58 in PI which points to the CRM box.
    I have been searching many forums and every solution seems to indicate increasing the lock table, the problem with that solution is we are currently trying to create (not process yet) 80000 IDOCu2019s. This would allocate too much for the lock table.
    So my question is this, Shouldnu2019t the lock be released when the IDOC gets created or none the less when a packet of IDOCu2019s via content management (breaking up the file in 1000 increments) finish. The lock table in CRM keeps increasing until all rows from the file, sent via IDOC adapter in 80 messages with 1000 IDOCu2019s per messagein the table are complete (80 separate messages in sxmb_moni).
    Background:
    IDOC was imported, changed to include unbounded and reimported.
    Content Management breaks the file into 80 different segments, thus creating 80 distinct mappings with distinct MessageIdu2019s.
    80 IDOC packets are sent to CRM, via IDOC adapter and sm58.
    TCODE sm12 in CRM shows the table to keep growing and locks not released until full message is complete.
    Any help would be appreciated
    Cheers
    Devlin

    The only way to process the IDOCs in this case is by increasing the "enque/table_size" parameter in order to create the required IDOCs. You can increase the value for this parameter up to 102400 (beyond that can cause performance issues). Since you need to handle 80000, this shouldn't be an issue.
    Please refer to the notes below for more information about the lock queue overflow and management.
    [Note 552289 - FAQ: R/3 Lock management|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=552289]
    [Note 13907 - System error in the block handler, overflow lock table|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=13907]

  • Table with FK with no Index created will LOCK TABLE during DML ?

    Hi all,
    Know that always create index for FK on table as FK's value will 99.9% be use in Where query on table.
    Had seen info with regards to the above and had not been successfull trying to simulate the  above using:
      DROP TABLE "TABLE2";
      CREATE TABLE "TABLE2"
       (     "A2" VARCHAR2(10 BYTE),
          CONSTRAINT "PK_A2" PRIMARY KEY ("A2") ENABLE
    Insert into TABLE2 (A2) values ('AAA');
    Insert into TABLE2 (A2) values ('BBB');
    Insert into TABLE2 (A2) values ('CCC');
    DROP TABLE "TABLE1";
      CREATE TABLE "TABLE1"
       (     "A1" VARCHAR2(10 BYTE),
         "A2" VARCHAR2(10 BYTE),
         "A3" VARCHAR2(10 BYTE),
          CONSTRAINT "PK_A1" PRIMARY KEY ("A1"),
            CONSTRAINT "FK_A1_A2" FOREIGN KEY ("A2")
           REFERENCES "LSD"."TABLE2" ("A2") ENABLE
    Insert into TABLE1 (A1,A2,A3) values ('111','AAA','yyy');
    Insert into TABLE1 (A1,A2,A3) values ('222','BBB','ZZZ');
      When i UPDATE A3 in TABLE1 using '111' record in SQLPlus without COMMIT,
    I was able to UPDATE A3 using '222' in another SQLPlus session, so it does not seems like table is LOCK.
    Questions.
    1. Am using 10GR2, is the above not applicable to 10G ?
    2. Or had understand the above concept wrongly  ?
    Thanks In Advance
    Zack

    Hi Legatti,
    I was able to UPDATE A3 using '222' in another SQLPlus session, so it does not seems like table is LOCK.   Thought that when updating more than 1 record in TABLE1 will caused TABLE1 to be LOCK.
    Now, try to perform an update on the TABLE1 like below:    SQL>update table1 set A3='aaa' where A1=111;
    And open an another session and perform this SQL below    SQL>delete from table2 where A2='BBB'; -- now it's hangs
      Yes !!! Very interesting, it hangs until i do a COMMIT on the UPDATE
    and DELETE session shows ORA-02292 Integrity Constraint violated as child record found.
      Now, when i create a index for A2 on TABLE1, it DOES NOT HANG and shows ORA-2292 immediately.
      So, is this the result of having no index for FK column (A2) on TABLE1 and when doing DML ,
    before COMMIT, will result in TABLE2 to be hang upon doing DML on TABLE2 ?
    Thanks for the valuable lesson learned.
    Zack                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Lock tables

    I would like to write something which allows me to flag if someone has locked a table.
    I have found this link which pretty much is asking the same thing I need to do, but I am not 100% how I can apply it.
    To me it seems that the procedure in this link is automatically locking table test_table, while I want to be able to flag when someone is locking a specific table without locking it in the procedure...if it makes sense
    http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/how-to-display-message-using-default-lock-in-oracle-9i-1571268
    Can you either clarify the link if possible or address me to a better solution?
    Thanks very much in advance

    is there a way to find out if a particular record in a specific table is locked, ratherthan the whole table itself?I don't think there is. That would involve looking at uncommitted data which Oracle won't let you do.
    You might be better off asking your question in the Database - General forum though General Database Discussions as there are some very clever people there who understand Oracle locking internals far better than I do.

  • Drop, create and insert data into few intermediate tables

    Hi All,
    I need to schedule a process to drop, create and insert data into few intermediate tables on a weekly basis. Here is what i need to do in the stored procedure, which can be scheduled weekly.
    DROP TABLE TABLE_NAME1;
    DROP TABLE TABLE_NAME2;
    DROP TABLE TABLE_NAME3;
    CREATE TABLE TABLE_NAME1
    CREATE TABLE TABLE_NAME2
    CREATE TABLE TABLE_NAME3
    INSERT INTO TABLE_NAME1 SELECT ....;
    INSERT INTO TABLE_NAME2 SELECT ....;
    INSERT INTO TABLE_NAME3 SELECT ....;
    Any suggestions, examples or code on how to accomplish this task would be very helpful. Any question pls let me know.
    Thanks in advance.

    I am using the intermediate tables in an extract process. The idea was that the table would be created prior to calling the extract procedure and once the data written to the intermediate table had been processed the table would be dropped. This would be repeated each time the extract process is run. From a DBA's point or view, would it be better to just leave the table on the database and truncate it after each run or is removing it entirely best?

  • MC603 Lock Table Overflow Error in Maintenance Order Settlement

    Hello,
    I am running RKO7KO8G- "Settlement of Maintenance Orders" program in background. For few Orders I am getting "MC603:Lock Table overflow " error. What might be the problem for this?
    Number of Order processed in a job is around 10,000.
    I checked in SM12 table.No entry is found
    Size of the Lock table details is
    Min - 4096
    Max - 102400
    Diff Value - 4096
    Profile Value - 10000
    Current Value - 10000
    Regards,

    Hello Srinivas,
    Please take a look at the below link.
    http://help.sap.com/saphelp_nw04/helpdata/en/37/a2e3ab344411d3acb00000e83539c3/content.htm
    As I already said, there is no standard value to define. You need to consider the no.of locks being generated and act accordingly to address this problem.
    I suggest you please go through the lock management documentation to address this kind of problems in the feature.
    Thanks,
    Siva Kumar

  • LOCK TABLE vs select for update

    Hello All,
    if the requirement is to lock an entire huge table to prevent any users from performing any update statement, which statement has more performance gain and why: LOCK TABLE or select fro update nowait?
    is there any overhead of using LOCK TABLE statement?
    Thanks,

    The reason I said to revoke update privilege is because I do not understand the requirement. Why do you want to prevent users from updating the table? I am assuming that users should never be allowed to update the table. In that case locking the table and select for update would be no good. If you want to stop users from updating while some one else is updating, why? All the lock table or select for update will do is cause their session to wait (hang) until the locking process commits or rolls back. This could generate a few (sic) complaints that the user application is slow/freezing.
    If you can state the business problem, perhaps we can offer a solution.

  • "Lock table overflow" error msg when trying to change a repot program

    hi ABAP experts,
    We are getting the following error msg
    "Lock table overflow
    Choose 'Display object' or 'Cancel'.".
    Click the question mark on the same error msg window, then the detailed error msg would like this:
    Message no. MC603
    Diagnosis
    This table overflowed when trying to enter SAP locks in the lock table.
    System Response
    The locks could not be set.
    Procedure
    Contact your system administrator. If this error occurs frequently, change the size of the profile parameter 'enque/table_size'. This parameter defines the size of the lock table in KByte.
    What would be the reason and how to resolve this problem?
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 2, 2008 1:03 PM

    Hi,
    This could be bcos the lock table is getting overflowed beyond the allotted space. Check if any other program/BAPI is causing continuous creation of locks.
    To analyze choose (SM12) Extras Statistics to display the statistics. These are the statistics that have been compiled since the last time the lock server was restarted.
    Check the below link for more information on SAP Lock Concept.
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
    For details on Subsequent Analysis of Lock Table Overflows, check the below links.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d3/43d2416d9c1c7be10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/f0/b57338788f4d72e10000009b38f8cf/content.htm
    Hope this helps. <REMOVED BY MODERATOR>
    Thanks,
    Balaji
    Edited by: Alvaro Tejada Galindo on Apr 2, 2008 1:03 PM

  • JDBC Lock Table

    I am developing two java programs that are accessing an Oracle database using JDBC. The two programs are to access to same table simultaneously.
    Is there a way I can use an sql LOCK TABLE command to lock a table while one program is writing to the table, and have the other program check for this Lock, and only proceed with updates on that table if the table is not locked? Would I need to have seperate database login IDs to accomplish this?
    For example:
    Program 1
    stmt.executeUpdate("LOCK TABLE A");
    //insert some records
    con.commit();
    Program 2
    While ( TABLE A IS LOCKED)
    //wait
    Update table A

    In future JDBC questions should be posted into the JDBC forum.
    Whatever you are doing don't. Just use transactions. Figure out what kinds of transaction serialization your setup supports too.

  • Locked table by an insert

    Hi,
    some times an insert locks all the concerned table this transaction is always from web.
    Any idea?
    regards.

    Here are some questions:
    How can the table be locked, preventing DML by other users?
    1) Is your application or users issuing SELECT FOR UPDATE commands
    2) Is your application or users issuing LOCK TABLE IN EXCLUSIVE MODE
    3) Is referential integrity being checked on foreign keys that do not have an index? If so, shared locks can be issued against the table limiting DML execution until the RI checks are complete.
    Are you sure there is a table lock?
    1) What are users waiting on when this problem occurs? Check v$session_wait for this. Also join v$session and v$lock on SID to see who has the lock(s) blocking the table.

  • Lock table is out of available lock entries

    Hi,
    I'm using BDB 4.8 via Berkeley DB XML. I'm adding a lot of XML documents (ca. 1000) in one transaction and get "Lock table is out of available lock entries". My locks number is set to 100000 (it's too much but still...).
    I know that I probably should not put so many docs in the same transaction, but why BDB throws "not enough locks" error? Aren't 100000 locks enough? (I also tried to set 1 million for testing purposes)
    As a side effect question, may I change the number of locks after environment creation (but before opening it)?
    P.S. Hope it's not offtop on this forum
    Thanks in advance,
    Vyacheslav

    Hello,
    As you mention, "Lock table is out of available lock entries" indicates that there are more locks than your underlying database environment is configured for. Please take a look at the documentation on "Configuring locking: sizing the system" section of the Berkeley DB Reference Guide at:
    http://www.oracle.com/technology/documentation/berkeley-
    db/db/programmer_reference/lock_max.html
    From there:
    The maximum number of locks required by an application cannot be easily estimated. It is possible to calculate a maximum number of locks by multiplying the maximum number of lockers, times the maximum number of lock objects, times two (two for the two possible lock modes for each object, read and write). However, this is a pessimal value, and real applications are unlikely to actually need that many locks. Reviewing the Lock subsystem statistics is the best way to determine this value.
    What information is the lock subsystem statistics showing? You can get this with db_stat -c or programmatically with the environment lock_stat method.
    Thanks,
    Sandra

  • Lock tables when load data

    Are there any way to lock tables when i insert data with SQL*Loader? or oracle do it for me automatically??
    how can i do this?
    Thanks a lot for your help

    Are there any problem if in the middle of my load (and commits) an user update o query data ?The only problem that I see is that you may run short of undo space (rollback segment space) if your undo space is limited and the user is running a long SELECT query for example: but this problem would only trigger ORA-1555 for the SELECT query or (less likely since you have several COMMIT) ORA-16XX because load transaction would not find enough undo space.
    Data is not visible to other sessions, unless, the session which is loading data, commits it. That's the way Oracle handle the read committed isolation level for transaction.
    See http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c21cnsis.htm#2689
    Or what happens if when i want to insert data someone has busy the table?You will get blocked if you try to insert data that has the same primary key as a row being inserted by a concurrent transaction.

  • A few post config questions on new setup

    Hi Group,
    Just a few post config questions.
    First, how can I confirm my controller is in fact associating properly with an NTP server?  On a typically cisco product, I could just do a 'show ntp associations' or a 'show ntp status'.  I cannot see a way to confirm this on the gui or command line.
    Second, on my guest network with web-auth, if one were to choose to not use https for web-auth and instead use unsecure http, would that be possible and if so where in the gui?
    Thanks.

    The third field is from a WLC running v7.4 not v7.2.  I usually would install a 3rd party certificate, but what eles you can try is issue this command on from the CLI.  It had issues working with certain code versions, but you might as well give it a try.
    config network web-auth secureweb disable
    Thanks,
    Scott
    Help out other by using the rating system and marking answered questions as "Answered"

  • System error: Unable to lock table/view V_T077K_M

    Hi,
    Not able to work on field selection (OMSG) i am getting an error "System error: Unable to lock table/view V_T077K_M" checked in SM 12 also, but dint get there anything.
    please cud you help me in this regard,

    contact your basis team,  there might be an overflow of the lock table because of mass changes from other users (even for other tables)

  • Table question/problem

    This is an html table question, but since I am working with
    CF on this, I thought I would post here for help.
    I query and cfoutput the data in a table. The table has ten
    columns. The first five are alpha numeric and the last five are
    numeric. The output displays fine.
    What the want to do now is to put a black border around the
    number columns, the last five.
    I tried to make each column its own table, but that just puts
    a box around each value, the columns are not connected.
    How can I do this ?
    Thanks for helping.

    Put a thin black left border in the sixth column and a
    similar right border in the tenth (last) column.
    It is neater and advisable to use CSS.
    <style type="text/css">
    <!--
    .bdrLft {
    border-left-color:#000000;
    border-left-width:thin;
    -->
    </style>
    <td class="bdrLft">
    The inline formatting will look like:
    <td style="border-left-color:##000000;
    border-left-width:thin;">
    Do the same for the top border (last 5 column headers). The
    bottom border may be trickier. The idea is to apply bottom border
    at the last query count. One can do without the top and bottom
    borders, however.

Maybe you are looking for

  • Problema para usar exemplos ou templates do Muse versão de avaliação

    Olá povo do Adobe Muse. Acabei de baixar cópia de avaliação; gostei muito da idéia do programa, mas estou com um problema para efetivamente poder testar o mesmo: Sou bastante leigo no assunto de criação de sites e pensei em começar pelos exemplos ou

  • Time machine has stopped backing up to time capsule. message is that sparse bundle is in use

    Time machine suddenly stopped backing up to time capsule returning this message: The backup disk image "/Volumes/Data-1/xxnymacbooknamexx MacBook.sparsebundle" is already in use.

  • Re: WD External drive won't mount

    Hi I have just experienced this issue today. I have gone through all the threads here and searched various other forums but haven't been able to come up with a solution yet. I might be missing something. I'm running a 2011 Mac Book Pro OS 10.9.5 Mave

  • App Won't Launch

    Just downloaded Disney Movies Anywhere App, but it won't launch at all. Any thoughts?

  • XML rendering in IE and Netscape

    Hi all, I have a simple servlet that streams xml data to the browser. When I view the page in IE it is formatted in the DHTML tree structure but with Netscape 7 it is messed up. However when I open an xml document directly in Netscape, it works! My J