Clarification On Contention and Transaction

Hi All;
I simply demonstrated Oracle's sequence mechanism own-made. I do not want ask about performance. My demonstration is below. When one of my friend see the code below, he asked me that in a multi-user environment, contention might occur and this contention would occur the same value for different processes. I had some tests but i could not get any problems. Updating and getting sequence is one transaction and function is automous.
Is the code below, can the same sequence can be generated?
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> drop table sequences;
Table dropped
SQL> create table sequences( name varchar2(32), current_value number, increment_value number );
Table created
SQL> alter table sequences add constraint pk_sequences primary key(name);
Table altered
SQL> insert into sequences values('T', 1, 1);
1 row inserted
SQL> commit;
Commit complete
SQL> CREATE OR REPLACE FUNCTION GetNextValue(pis_SequenceName VARCHAR2)
  2    RETURN NUMBER IS
  3    PRAGMA AUTONOMOUS_TRANSACTION;
  4    vn_NextValue NUMBER;
  5  BEGIN
  6    UPDATE sequences
  7       SET current_value = current_value + increment_value
  8     WHERE NAME = pis_SequenceName RETURNING current_value INTO vn_NextValue;
  9    COMMIT;
10    RETURN vn_NextValue;
11  END GetNextValue;
12  /
Function created
SQL> show err;
No errors for FUNCTION HR.GETNEXTVALUE
SQL> CREATE OR REPLACE FUNCTION GetCurrentValue(pis_SequenceName VARCHAR2)
  2    RETURN NUMBER IS
  3    vn_CurrentValue NUMBER;
  4  BEGIN
  5    SELECT current_value
  6      INTO vn_CurrentValue
  7      FROM sequences
  8     WHERE NAME = pis_SequenceName;
  9    RETURN vn_CurrentValue;
10  END GetCurrentValue;
11  /
Function created
SQL> create sequence seq_test_t
  2  start with 1
  3  increment by 1
  4  nocache;
Sequence created
SQL> SELECT GetNextValue('T') ud_next1
  2        ,GetCurrentValue('T') ud_curr1
  3        ,GetNextValue('T') ud_next2
  4        ,seq_test_t.NEXTVAL next1
  5        ,seq_test_t.CURRVAL curr1
  6        ,seq_test_t.NEXTVAL next2
  7    FROM dual;
  UD_NEXT1   UD_CURR1   UD_NEXT2      NEXT1      CURR1      NEXT2
         2          2          3          1          1          1
SQL> My tests are:
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> drop table t;
Table dropped
SQL> create table t(x varchar2(1), i number );
Table created
SQL> alter table t add constraint uk_i unique(i);
Table altered
SQL> SELECT * FROM t GROUP BY i HAVING COUNT(*) > 1;
SELECT * FROM t GROUP BY i HAVING COUNT(*) > 1
ORA-00979: not a GROUP BY expression
SQL> SELECT i FROM t GROUP BY i HAVING COUNT(*) > 1;
         I
SQL> SELECT count(*) from t;
  COUNT(*)
     50000
SQL>
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> set serverout on 1000
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE( 'Start A ' || dbms_utility.get_time );
  3    FOR i IN 1 .. 10000 LOOP
  4      INSERT INTO t VALUES ('A', GetNextValue('T'));
  5      COMMIT;
  6    END LOOP;
  7    DBMS_OUTPUT.PUT_LINE( 'End  A ' || dbms_utility.get_time );
  8  END;
  9  /
Start A 9904878
End  A 9906156
PL/SQL procedure successfully completed
SQL>
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> set serverout on 1000
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE( 'Start B ' || dbms_utility.get_time );
  3    FOR i IN 1 .. 10000 LOOP
  4      INSERT INTO t VALUES ('B', GetNextValue('T'));
  5      COMMIT;
  6    END LOOP;
  7    DBMS_OUTPUT.PUT_LINE( 'End B ' || dbms_utility.get_time );
  8  END;
  9  /
Start B 9904928
End B 9906018
PL/SQL procedure successfully completed
SQL>
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> set serverout on 1000
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE( 'Start C ' || dbms_utility.get_time );
  3    FOR i IN 1 .. 10000 LOOP
  4      INSERT INTO t VALUES ('C', GetNextValue('T'));
  5      COMMIT;
  6    END LOOP;
  7    DBMS_OUTPUT.PUT_LINE( 'End C ' || dbms_utility.get_time );
  8  END;
  9  /
Start C 9904982
End C 9906104
PL/SQL procedure successfully completed
SQL>
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> set serverout on 1000
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE( 'Start D ' || dbms_utility.get_time );
  3    FOR i IN 1 .. 10000 LOOP
  4      INSERT INTO t VALUES ('D', GetNextValue('T'));
  5      COMMIT;
  6    END LOOP;
  7    DBMS_OUTPUT.PUT_LINE( 'End D ' || dbms_utility.get_time );
  8  END;
  9  /
Start D 9905045
End D 9905768
PL/SQL procedure successfully completed
SQL>
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> set serverout on 1000
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE( 'Start E' || dbms_utility.get_time );
  3    FOR i IN 1 .. 10000 LOOP
  4      INSERT INTO t VALUES ('E', GetNextValue('T'));
  5      COMMIT;
  6    END LOOP;
  7    DBMS_OUTPUT.PUT_LINE( 'End E ' || dbms_utility.get_time );
  8  END;
  9  /
Start E9905109
End E 9906189
PL/SQL procedure successfully completed
SQL>
A Start     B Start     C Start     D Start     E Start                                         D End     C End           A End           B End           E End
9904878     9904928     9904982     9905045     9905109      "All 5 proceeses are working here"  9905768     9906104     9906156     9906156     9906189

Since you're serializing the sequence generation through an autonomous transaction with an UPDATE statement, I don't see how it should be possible to generate duplicates. Ask your friend to provide a test case, I'd say.
C.

Similar Messages

  • Diff B/W master data and transaction data

    Hi all,
    What is the main Diff B/W master data and transaction data.  give me some example ?
    Thanks in Advance
    Krish...

    hi krish,
    MASTER Data is the data that exists in the organization like employee details, material master, customer master, vendor master etc. These are generally created once.
    Master data are distributed throughout the company, they are often not standardised and often redundant. As a result it is very costly to offer efficient customer service, keep track of supply chains and make strategic decisions. With SAP Master Data Management (SAP MDM) these important business data from across the company can be brought together, harmonised and made accessible to all staff and business partners. As a key component of SAP NetWeaver, SAP MDM ensures data integrity via all IT systems.
    Regardless of the industry, companies often work with different ERP and Legacy systems. The result: the business processes are based on information about customers, partners and products which is displayed in different ways in the systems. If the data are recorded manually, there are more inconsistencies: some data sets are entered several times, others cannot be retrieved by all divisions of the company.
    As corporate applications are becoming increasingly complex and produce ever greater amounts of data, the problem is intensified further. Nevertheless, your employees must work with the inconsistent data and make decisions on this basis. The lack of standardised master data easily leads to wrong decisions, which restrict efficiency and threaten customer satisfaction and profitability.
    In a word: in order to save costs and ensure your company’s success it is necessary to consolidate master data about customers, partners and products, make them available to all employees beyond system boundaries and use attributes valid company-wide for the purpose of description.
    TRASNACTION Data - These are the business documents that you create using the master data - Purchase orders, sales orders etc
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/193e4045796913e10000000a1550b0/content.htm
    Regards,
    GNK.

  • Can i display My application iview and transaction iview in single page ?

    Hi,
    I am new in web dynpro and portal. i am doing one approval application through web dynpro. Now i need to attache sap inbox to application. For that some budy suggested me about transaction view. So my questions are as folloes.
    1.> How i attached my application to iview ?
    2.> How i created Transaction  iview ?
    3.> Can i attache my application iview with transaction iview if it is possible then how ?
    4.> Can i display My application iview and transaction iview in single page ?
    Please guide me in this procesure.
    Regards,
    Gurprit Bhatia

    Hi Gurprit,
    1.> How i attached my application to iview ?
           You can attach your application to web Dynpro IView, for this login into portal, in the Content Management tab right click on a folder, then New --> IView. Select WD java Application. Select your application and create an Iview.
    2.> How i created Transaction iview ?
           Similarly, instead of selecting WD java Application, select iView template, you will get a list of available templates, and in this you will find template for Transaction Iview, in this template define the Tx for which you want to create the template.
    3.> Can i attache my application iview with transaction iview if it is possible then how ?
          No, I dont think you can attach your application to transaction Iview. but, you can attach both IViews on single page.
    4.> Can i display My application iview and transaction iview in single page ?
          Yes, you can attach  both IViews on single page. Again in Content Management tab, crate a PAGE; Then right click on created IViews and select  add IView to Page ßß: Delta Link.
    Hope this helps.
    Regards,
    Amit

  • Pass parameter through standard page "import xml content and actions"

    Dear Portal experts,
    As you know, a standard portal page is configured to allow the import of XML file. It is located in the portal in the path system admin -> transport -> xml content and actions -> import
    I configured a quick link u201Cimportu201D to the page so now the link http://myserver:port/irj/portal/import allows me to access directly to this screen.
    What I would like to do now is to pass the parameter related to u201Cfile nameu201D through this screen meaning that I would like that http://myserver:port/irj/portal/ import/filename=C:\test.xml  fills automatically the fields u201CXML fileu201D with  C:\test.xml 
    Please do you know how to achieve this ?
    Thank you very much and regards

    hi,
    @Maksim :
    When user launch an URL like http://myserver:port/irj/portal/ import/*filename=C:\test.xml, he is requested to provide username and password; as this link is a shortcut for the upload xml page, there is a check of authorization and only portal admin that have authorization and permission on this page/iview will be able to upload xml file through the URL. Hope this clarify.
    @Kumar :
    thank you for your answer. What a pity to not be able to pass parameter through standard portal page/iview particularly knowing that we can pass paramater through many kinds of iviews (transactional iview, url iview, VC iview...). I explored some option on file com.sap.portal.ivs.init.par but this was unsuccessful. However, thanks to this [link bellow|http://wiki.sdn.sap.com/wiki/display/Snippets/ComponenttouploadXMLfilewithPCD+objects], I was able to upload through URL the XML file.
    The problem is that I can upload only XML file that are stored in the server not in the local user computer. My requirement is to be able to upload local XML file stored on user's computer.
    If someone could provide and idea/solution, I would be very grateful.
    Cheers

  • Line Item and Transaction Figures

    Hi experts,
    What is the difference between line items and transaction figures ?
    I have gone through a document which specifies for Line items GL AR AP, it picks data respectively frm tables BSEG/BKPF, BSAD/BSID, BSAK/BSIK and for transaction figures GLT0/GLFUNCT, KNC1/KNC3, LFC1/LFC3.
    What data 0FI_XX_6 fetches into BI when compared with 0FI_XX_4 ?
    Please clarify.
    Regards,
    Bhadri M.

    Hi,
    What are Transaction Figures :
    Transaction figures are the sums of line items on the debit or credit side. The balance is the
    difference between the debit and the credit transaction figure.
    What is  line items :
    Line items are document items that were posted to a specific account. In contrast to a document item a line item only contains the information from the document that is relevant from the account view.
    You can display the following line items:
    Open items Cleared items Noted items Parked items Items with special G/L transactions (in Accounts Receivable and Accounts Payable)
    Items with customer or vendor items (in Accounts Receivable and Accounts Payable)
    You can display the line items for the following account types:
    Customer accounts
    Vendor accounts
    G/L accounts
    Point No 1:
    0FI_XX_6 : Transaction Figures:
    http://help.sap.com/saphelp_nw04/helpdata/en/41/4b73415fb9157de10000000a155106/content.htm
    0FI_XX_4: Line-Item
    http://help.sap.com/saphelp_bw33/helpdata/en/af/16533bbb15b762e10000000a114084/content.htm
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Dec 22, 2009 10:46 AM

  • IIS Web Farm - File Server for Content and Shared Configuration - SOFS?

    We currently have a number of web farms with their content and shared configuration files located on a standalone file server.
    I am looking to utilise the clustered file server role in Windows 2012 to provide improved uptime and load balancing for the configuration and content shares.
    Please could someone provide clarification as to whether SOFS is supported for this scenario?
    There appears to be some conflicting advice in the documentation and across the internet.

    We currently have a number of web farms with their content and shared configuration files located on a standalone file server.
    I am looking to utilise the clustered file server role in Windows 2012 to provide improved uptime and load balancing for the configuration and content shares.
    Please could someone provide clarification as to whether SOFS is supported for this scenario?
    There appears to be some conflicting advice in the documentation and across the internet.
    SoFS is a good choice for a) Hyper-V and b) SQL Server (anything working with a big files like VHDX and MDF). For a bunch of a small files IIS has in a shared directories SoFS is not going to work and it's cleary said in the documentation. See:
    Scale-Out File Server for Application Data Overview
    http://technet.microsoft.com/en-us/library/hh831349.aspx
    Workload: Information worker
    Yes
    Not recommended
    Workload: Hyper-V
    Yes
    Yes
    Workload: Microsoft SQL Server
    Yes
    Yes
    So in your case just an ordinary clustered file servers should be enough. See:
    Create a Clustered File Server
    http://technet.microsoft.com/en-us/library/cc753969.aspx
    Hope this helped :)
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • Installation of Business content  and activation

    Hello,
    Our Source system is ECC 6.0 and
    BW :NW2004 S and SAP NetWeaver BI 7.0 .
    We are able to create source system conection successfully . after installing the business content and replication, all the data souces in BW are still in Version D only. Do i need to select each DS individually to activate ?  or am i missing any steps ?
    Any help is highly appreciated ? 
    Regards

    Hi,
    I was also passed this latest information from my colleagues in Product Management.
    The method I explained is the old method for activating DataSources and extractors. It is still valid in SAP NetWeaver 2004s but there is a new, and easier, methid to do this now.
    Also if you have followed my instructions, there is an additional change in the replication process and a decision you must make:
    <i>"Once the customer has activated the DataSource via rsa5 in source system, then he/she needs to replicate this datasource to BI. During the replication, he/she is asked via pop-up whether he would like to replicate these datasources as 3.X DataSource or 7.0.x DataSource.
    If he decides to replicate these datasources as 7.0.x DataSources, then the A version of this datasource will be seen in table RSDS, instead of the original table RSOLTPSOURCE.
    So if the customer checked table RSOLTPSOURCE, then he/she only see the D version.
    This could be the reason that customer still only see D version after the datasource replication."</i>
    The new method is:
    <i><b>"- If you have a 3.X datasource, during the source system connection, the D
    version of DataSource is already replicated into BI.
    - With transaction RSOR in BI, you need to select the related transfer rule, and via transfer rule you are able to collect the 3.X DataSource.
    - Then you need to push 'install' button to activate this datasource.
    - After activation, the A version of DataSource will be available in BI and in Source system.
    - If you have a 7.0.x DataSource, the steps are the same like 3.X datasource. But via transaction RSOR you are able to directly select this datasource (object type RSDS).
    So with BI capabilities of NetWeaver2004s technology, it's no longer nessary to run rsa5 in the source system to activate the datasource."</b></i>
    I hope this helps,
    Mike.

  • Content in transaction /SAPCND/GCM where is it stored?

    Hi!
    When you populate scaling data in transaction /SAPCND/GCM you add a valid date in field KSTBS (ex.2006.12.31). Where is the connection with table PRCD_COND? <b>What is wrong with table PRCD_COND if the KSTBS field is not updated with the same dates as in transaction /SAPCND/GCM. It contains the date 99991231 instead.</b> The table CNCCRMPRSAP005 is empty. Where is the content from transaction /SAPCND/GCM (regarding scales) stored?
    Regards Christina

    PDF's are handled with the iBooks app between iOS devices and OS X. If you have created a pdf on your Mac, drag and drop it on the iBooks icon (or open collection) and it will be stored in iCloud and accessible from your iOS device. If someone sends you a pdf in Mail on your iOS device, you can tap on the pdf and choose 'Open iniBooks' and it will be stored in iCloud and accessible from your other devices.
    Hope this helps!

  • BI content and LO extraction difference

    Hi ,
    Please tell me
    1) what is the main difference between BI content and LO extraction.
    2) What happens when we install business content and what happens when we do LO extraction.why are we doing this extraction.?
    3) Which process must be done first.
    and LO is for logistics extraction i.e. SD,MM etc.(please correct if i am wrong)
    4) what about extraction with respect to finance is there anything like LO extraction for finance also?
    please explain in simple english.
    regards
    lap.

    1) what is the main difference between BI content and LO extraction.
    BI contenat means the objects delivered by SAP. This includes data sources, data providers, info objects, udate rules, transfer rules, reprots, etc etc.
    LO extraction refers to the process of extracting logistics data.
    So, these two are not comparables.
    2) What happens when we install business content and what happens when we do LO extraction.why are we doing this extraction.?
    When you install BI content, all the objects ( depending on the mode of collection in RSA1 - business content) and if they are already present in the system in which is installed, merge.
    LO extraction, as said in 1. above,  when you extract LO, depending on the application area, it extracts the transaction data. For example, if you chose extract Sales order information, it picsk all the sales order data from the R/3 system.
    3) Which process must be done first.
    You need to install the BI first before you start the LO extraction process.
    and LO is for logistics extraction i.e. SD,MM etc.(please correct if i am wrong)
    YES, you are right. LO referes to all LO processes such as SD, MM, PM, PP, QM, CS. etc.
    4) what about extraction with respect to finance is there anything like LO
    For all other extractors, there is no special steps like LO. However, for COPA and FISL there wont be any BI content data sources.
    Ravi Thothadri

  • Import master and transaction data

    Hallo,
    I need the information, how I can import master and transaction data.
    I fellow the introductions from SAP.Help (see Link), but the Programm UPB_DATA_IMPORT
    is failed. (See point 3 in Link):
    http://help.sap.com/saphelp_nw04/helpdata/en/7a/6d313f8815d036e10000000a114084/frameset.htm
    If I want to try point 3. The error massage.
    “Program UPB_DATA_IMPORT does not exist Message no. DS017”
    will result.
    What I can do? Who can me say why I haven’t the Programm UPB_DATA_IMPORT?
    What is wrong?
    Please help me.I need Data to make a demo planning
    thanks

    Hi,
    There is a set of objects in business content (check under SAP DEMO in business content). You can activate some or all of these demo objects (for example demo cubes).
    There are programs which you can then execute to create the datafiles which can then be loaded to these demo cubes.
    " Start report RSO_BC_FILES_IN_BDS (Transaction SE 38), specify the required (Demo) InfoObject/InfoCube and choose the "Start BDN" button. The system will display all (generally one) CSV files which were supplied with the InfoObject/InfoCube. You can either export this CSV file into a local directory or you can write it directly onto the application server. For loading, proceed as described under section 1. " --- from OSS note 370397

  • Can I take a PC's contents and place it on a disk partition?

    I have an existing Windows PC (XP SP2) I would like to put on my Mac.
    Can I just take its contents and place it on a partition, then install the drivers? Or do I have to do a fresh install, get a new disk, yadda yadda yadda?

    Clarification: Can I take the files and Windows components of the PC and place it on the Mac using an external HD or other transfer method?

  • IPhone 4 "erase all content and settings"

    Okay first off, I would really appreciate some real and thoughtful answers. So my friend so me his iPhone 4 from Verizon Wireless. It still has service that he pays for (but I give him money each month to pay for it) I gave him money for the service for this month, but I want to wipe the service early because I found out that he was tracking my location and calling me out when I tell him I'm somewhere so I can't hang out (When I tell him the truth, that I have plans or just don't want to go he threatens to kill himself) I paid for the phone and want to keep it but I don't want him to keep tracking me as I plan to finally discontinue this exhausting friendship afterward and would like to not be tracked. He does have this still registered with his mom's apple id with track my iPhone from when he had the phone. I guess my real question is, does using the erase all content and settings make MY iPhone completely unavailable to him (Including content and location or even know if I decide to sell it) If this works, I plan on creating my own apple ID to set it up with and paying for my own Verizon Wireless account. Any REAL help that actually has information that I would want would help. If you need any clarification just put it in your question and check back for my Additional Details. Thank you(: what about a jailbreak or unlock? And are you sure it doesn't get rid of the Verizon because I just tried it and it says "No Service" where "Verizon Wireless" usually is

    Boot into recovery mode, connect it to iTunes and restore

  • Issues with XML Content and Actions to import RRA in FPN (EP7 SPS13)

    Hi,
    I am having trouble using the import functionality of XML Content and Actions to transport Remote Role Assignments between Consumer Portals. Whenever I want to upload an XML file containing RRA for Roles and Groups that were already assigned to eachother, the import fails and nothing is updated. The error I get:
    UMException. Data could not commit to Role: gp:/[full ID of portal role]
    Anyone with experience in how to use this?
    Kind regards,
    Christian Staalby

    hi,
    @Maksim :
    When user launch an URL like http://myserver:port/irj/portal/ import/*filename=C:\test.xml, he is requested to provide username and password; as this link is a shortcut for the upload xml page, there is a check of authorization and only portal admin that have authorization and permission on this page/iview will be able to upload xml file through the URL. Hope this clarify.
    @Kumar :
    thank you for your answer. What a pity to not be able to pass parameter through standard portal page/iview particularly knowing that we can pass paramater through many kinds of iviews (transactional iview, url iview, VC iview...). I explored some option on file com.sap.portal.ivs.init.par but this was unsuccessful. However, thanks to this [link bellow|http://wiki.sdn.sap.com/wiki/display/Snippets/ComponenttouploadXMLfilewithPCD+objects], I was able to upload through URL the XML file.
    The problem is that I can upload only XML file that are stored in the server not in the local user computer. My requirement is to be able to upload local XML file stored on user's computer.
    If someone could provide and idea/solution, I would be very grateful.
    Cheers

  • How to start Designing Master Data and transactional Data

    Can anyone tell me how to really start to design Master Data and transactional Data in Sales? What are the steps if is it possible to share? Thanks!

    Hi Lei,
    first step is to read all necessary document on help.sap.com about Business Content for SD. Here you can see all the parts covered directly by SAP with the Business Content.
    Then you can start the GAP analysis: you check if all your requirements are fully covered by BC or not, in this second case you can start developing your own InfoObjects.
    Start always by Business Content.
    Take a look also at this doc:
    <a href="https://websmp110.sap-ag.de/form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700002719062002E">https://websmp110.sap-ag.de/form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700002719062002E</a>
    Ciao.
    Riccardo.

  • Contention for Transaction Enqueue

    Hi,
    What can cause contention for Transaction Enqueue?
    Warm regards,

    Hi
    Run Statspack report and it will give you a detail information. It may be the concenteration of mostly used tables on one drive, etc ........the best way is to run the statspack reports.........

Maybe you are looking for