Will a sequence return same value for two different sessions?

Is there a possibility that a sequence will return same value to two different sessions when it is referred exactly at the same instance of time?

@Justin... Thanks for your insight; indeed, we too feel this shouldn't ever happen and never heard of it either, but there it is. (No, we haven't logged a TAR yet -- whatever that is -- partly because it didn't occur to us and partly because we only recently came across the issue and sensibly want to do some testing before we cry foul.)
However, the code is pretty straight-forward, much like this (inside a FOR EACH ROW trigger body):
SELECT <seqname>.NEXTVAL INTO <keyvar> FROM DUAL;
INSERT INTO <tblname> (<keyfield>, <... some other fields>)
VALUES(<keyvar>, <... some other values> );
(where <tblname> is NOT the table on which the trigger is fired). This is the only place where the sequence is ever accessed. The sequence state is way below its limits (either MAXVALUE or <keyfield>/<keyvar> datatype size).
In this setup, end users sometimes got an out-of-the-blue SQL error to the effect that uniqueness constraint has been violated -- as I said, we used to have a unique index on <keyfield> -- which leads us to assume that the sequence generated a duplicate key (only way for the constraint to be violated, AFAIK). We released the constraint and indeed, using a simple SELECT <keyfield>, COUNT(*) FROM <tblname> GROUP BY <keyfield> HAVING COUNT(*)>1 got us some results.
Unfortunately, the <tblname> table gets regularly purged by a consumer process so it's hard to trace; now we created a logger trigger, on <tblname> this time, which tracks cases of duplicate <keyfield> inserts... We'll see how it goes.
@Laurent... winks at the CYCLE thing Our sequence is (needless to say) declared as NOCYCLE and the datatype is large enough to hold MAXVALUE.

Similar Messages

  • HashCode method return same value for different string?

    Hello. I am finding hashCode method of string return same hashcode for many different string? It seem when string is long we get same value many times? What is solution? I am useing JDK 1.0.2. Thank you.

    Hello. I am finding hashCode method of string return
    same hashcode for many different string? There are about 4 billion possible hashcode values.
    How many possible strings do you think there are?
    Obviously many strings will have the same hashcode.
    What is
    solution?The solution is to not depend on hashcodes being unique.

  • Is it possible to use the same Switch for two different clusters.

    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.

    user9198027 wrote:
    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.
    Yes.  Technically there will not be any conflict as long as the private addresses used by the 2 clusters do not collide, and provided that the switch's port capacity and bandwidth will not be exceeded.
    Your NA (netadmin) can also configure the switch to separate the 2 Interconnects from one another (called partitioning when using Infiniband) - if the switch supports such features.
    A major consideration is not to make the switch, public. That typically cause a range of problems and can have a serious impact on an Interconnect. But using 2 private networks on the same infrastructure should not have the same problems - if configured and implemented correctly.

  • SCCM 2012 Reporting Code Returns Same Value For Total Number Of Required Updates Per Computer

    I'm trying to make a custom report in SCCM 2012 R2 with SQL 2012 since Microsoft took out the ability to list the number of updates needed per computer. This was in WSUS reporting but is not in SCCM reporting. I've made a custom report for this but can't
    quite get it to work. The report runs but the same value for total number of updates needed shows up for every computer. I took a query from one report and am trying to get it to run inside the select statement from another report. Here is the code as it is
    right now:
    declare @CI_ID int; select @CI_ID=CI_ID from fn_rbac_ConfigurationItems(@UserSIDs)  where CIType_ID=9 and CI_UniqueID=@AuthListID
              declare @StateID int
              select @StateID=StateID from fn_rbac_StateNames(@UserSIDs)  sn where sn.StateName=@StateName and TopicType=300
              declare @RequiredUpdateCount int
              select @RequiredUpdateCount=Count(v_StateNames.Statename) from   
    v_StateNames,   
    v_Update_ComplianceStatusAll   
    Inner Join v_R_System On (v_R_System.ResourceID = v_Update_ComplianceStatusAll.ResourceID)   
    Inner Join v_UpdateInfo On (v_UpdateInfo.CI_ID = v_Update_ComplianceStatusAll.CI_ID)   
    where   
    v_StateNames.TopicType = 500 and   
    v_StateNames.StateID = v_Update_ComplianceStatusAll.Status and   
    v_StateNames.Statename = 'Update is required'   
    Group By v_R_System.Name0
              select
                ccm.ResourceID,
                rs.Name0+isnull('.'+rs.Resource_Domain_or_Workgr0, '') as MachineName,
                rs.User_Domain0+'\'+User_Name0 as LastLoggedOnUser,
                asite.SMS_Assigned_Sites0 as AssignedSite,
                rs.Client_Version0 as ClientVersion,
    @RequiredUpdateCount as RequiredUpdates  
              from fn_rbac_ClientCollectionMembers(@UserSIDs)  ccm
              join fn_rbac_Update_ComplianceStatusAll(@UserSIDs)  cs on cs.CI_ID=@CI_ID and cs.ResourceID=ccm.ResourceID
                and (@StateID=0 and cs.Status=0 or @StateID=1 and cs.Status in (1,3) or @StateID=2 and cs.Status=2)
              join fn_rbac_R_System(@UserSIDs)  rs on rs.ResourceID = ccm.ResourceID
              left join fn_rbac_RA_System_SMSAssignedSites(@UserSIDs)  asite on asite.ResourceID = ccm.ResourceID
              where ccm.CollectionID=@CollID
              order by MachineName
    Ben JohnsonWY

    There's plenty wrong with it. It gives you no idea of how many patches each box needs. Then you have to click on each computer, click the sort arrow by the "required" column, and count the number needed. When you have hundreds of computers to work on this
    is a big deal as it's very time consuming. What's great about the view in WSUS that had this is that it listed this for you and you could sort the required column. So if have most computers needing 2 patches, you can go find the one that needs 40 and 150 (to
    over exaggerate) and put the time on them needed to see why they're so far behind. The WSUS format was quick, easy, and informative. SCCM makes getting this info a royal PITA which is why I'm (and many others) so royally peeved at MicroShaft for removing this
    functionality, but that's what we've all come to expect from MicroShaft--just like when then took the nice colorful themes out of Office 2010 and replaced them in Office 2013 with just white, gray, and a darker gray. That's super boring and actually hurts
    my eyes.
    Ben JohnsonWY

  • Qry return same value for a particular column for each row but not all time

    hi,
    We recently migrated to Oracle Database 10.2.0.3.0 from 9i. We were using a sql to populate a table and it had been running fine. After migration the same sql is fetching / population incorrect values, but not everytime. If we run the same sql again it gives a correct result.
    Ex:
    insert into a1 ( col1, col2, col3 )
    select a.field1, b.field2, c.field
    from tab1 a, tab2 b, tab3 c
    where a.field = b.field
    and b.field (+) = c.field
    something like this. Let us assume it fetches 200 rows
    But sometimes the col1 has the same value for all the 200 rows and col2, col3 has correct values. If we run the same sql next time, the col1 fetches the correct value and everything is correct.
    Could someone help on the above issue.

    I know it's difficult but can you put together a small test case for us to reproduce this behaviour? Did you contact Oracle Support?
    Any special constructs used behind the scenes? Virtual private database? Views?Materialized Views? Anything else?

  • Can i load two different itunes on the same computer for two different ipods?

    Can I load two different itunes on my computer for two different ipods?  Or how can I get it so that when I click on itunes, only my songs come up and not my wifes?  And the same for her.

    Yes.  The simplest way is to have separate Windows accounts for each user.  When either user runs iTunes, he/she will have a separate library with distinct content, playlists, etc., and can sync individual iDevices as needed.

  • How to use same DFF for two different forms with :BLOCK.field reference

    Hi,
    Can anyone suggest how to use the same dff in two different forms by using :BLOCK.field reference.
    Scenario is the same DFF is referenced by two forms, viz. Form-1 & Form-2.
    Form-1 Reference Field is :BLOCK.field name, but the same block is not available in Form-2, which throws an error while opening it.
    Any pointers please.
    Thanks,

    In the environment I currently have access to do not have similar setup.
    Let say you setup the DFF1 default value to $HEADER.customer_name, the name of the DFF is CUSTOMER_NAME, description can be anything.
    In DFF2, default value should be a SQL, where you can reference the DFF1. For example, SELECT DECODE($FLEX.CUSTOMER_NAME, 'ABC', 1, 'DEF', 2, NULL) FROM dual
    In this case, you can reference the DFF1.

  • Content Conversion- Same keyfield value for two different sub structure

    Hi,
    I have a scenario where the key field value for the 2 substructure of record structure is same.
    MY XML structure is like this :
    <documentName>
       <recordset>
    <Header>
        <field-nameA1>
        <field-nameA2>
        <field-nameA3>
    <ITM1>
       <field-nameB1>
       <field-nameB2>
       <field-nameB3>
    <ROW1>
       <field-nameB1>
       <field-nameB2>
       <field-nameB3>
    <ITM2>
       <field-nameB1>
       <field-nameB2>
       <field-nameB3>
    <ROW2>
       <field-nameB1>
       <field-nameB2>
       <field-nameB3>
    The sample text file is given below where line no. 3 and 5 are different substructure(For ROW1 and ROW2 respectively) with same keyfield value.
    "HDR",399,"file",20050302,100642,3289
    "ITM1",2,3,4,5,6,7,8,9,10
    "ROW",3,4,5,6
    "ITM2",2,3,4,5,6,7,8,9,10
    "ROW",7,8,9,10
    After content conversion I get a XML structure in which there is no ROW2 and all data within the fields of ROW2 are put under ROW1 as the key field values are identical.
    In the records only the first field is constant (e.g. ROW).
    How to handle such a scenario?
    Regards
    Satish Chauhan

    Unless you can somehow expand the key, I don't know that this is possible.  The key implies uniqueness - and in your case, unfortunately, it isn't.  Is there any way to edit the structure to make it more unique for you?  Do you have any control or ability to change that?
    Maybe if you add unique keys in your mapping, you can strip them off with content conversion on the way out using the parameter keyFieldInStructure=ignore?

  • Hi how will get subquery returns multiple values for main query

    Hi all ;
    here i given one sql query
    1)select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '|| initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b.name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100;
    if i run this above query returning multiple values depend on sa.mgr values.
    like output coming like this
    yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    2) this sub query i am passing with main query
    select sa.mgrid,sa.sal,(select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '||
    initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b .name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100)" test " from table4 sa,table5 te ,table6 ft where sa.id(+)=te.id and sa.mgr=ft.mgr;
    my final out put required like this:
    mgrid sal test
    100 20000 yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    but i am getting erro:
    1)missing paranths
    2)single row subquery return more then one row.
    hi kindly give me answer to me as soon as possible
    Edited by: anbarasan on Sep 29, 2008 9:48 PM

    I refuse to read all of that code and guess what error message you are getting. Apparently others feel the same way.
    Run the final SQL statement and then cut and paste the code and full error statement into a post.
    Also include your full version number to three decimal places.
    My refusal is not an unwillingness to help you but rather an unwillingness to spend 10 minutes reconstructing what you could have pasted in in a fraction of a second. We are all volunteers here and there are many people that need help. I hope you understand.

  • Service Registry: Publish the same service for two different business syst.

    Hello all,
    i am trying to publish a webservice in the Service Registry of a PI 7.1 EHP1 and i'm facing a problem. I have configured two Business Systems that use the same Service Interface, let's say Dev and Qua systems. So, this two business systems can be senders of the webservice. I have been able to publish the first Sender Agreement properly, but when i try to publish the second Sender Agreement as the service is already publish i get the following error:
    One service definition with the same name 'SI_I015_EneGISDeviceLocationServicesInternalMessage_In(urn:enemalta.com.mt:iubs:integrations)' found; do you want to delete this object from the Services Registry and continue publishing?
    I've been told that this error might be a permission problem but the user i am using has all the permissions required. Does anyone know how to solve this issue?
    Thank you very much in advance!
    Roger Allué i Vall

    Hi Roger,
    Is that problem solved for you?
    I am looking for inputs on a similar issue here. I need to have a single service but with two different endpoints (for two sender business systems) published in SR.
    Thanks,
    Marz

  • Do you set up two itunes accounts on the same computer for two different people

    I have an ipod and my girlfriend has an iphone. We have one computer and when we fire up itunes it always thinks it was the last one that linked. We have different tastes and we do not want to synch the same tracks. How do we set up and migrate between two different itunes ?
    Thanks, Sorry if its a basic question but it is driving us crazy

    How to use multiple iPods, iPads, or iPhones with one computer

  • HT204053 How do I use the same email for two different apple IDs?

    I have inadvertently created two different Apple IDs throughout the years but now need my most recent one to use my email, but still want access to my old apple ID (if I can find it). The old apple ID has priority (the new one is not allowed to verify my email as it is linked to my old ID) with that email - can someone help me have the two IDs linked to the same email?
    Thank you

    AFAIK this is Not Possible. Each ID requires a Unique address
    Apple ID FAQs
    http://support.apple.com/kb/HE37

  • Two browser with same site having two different session

    Hai Experts................
    I have a problem that with session............
    when we logged in one site with our username and password, and
    then i try to log in same site with other username and password in another browser
    then how to know is there any browser is open with any other username and password in the same site.
    I want to give this checking in the client side.....

    You could use cookies, but this will only allow you to detect multiple uses of the same browser like two instances of IE. This won't work if you are using IE and you open another different browser such as Firefox.
    I think you are out of luck :)

  • Random returning same values for all threads?

    <p>I "translated" an Applet example from a book to a MIDlet (as part of my learning process). However the MIDlet does not react as it should, and when the particles are all moving independently in the Applet, they are stuck together (as one) in the MIDlet.</p>
    <p>So far, only one possibility was suggested to me: if the Random object are created one after the other, they could end up based on the same seed (which is the clock by default) and will generate the same numbers.</p>
    <p>I tried to delay between the creation of the threads with no result. And the fact that the applet runs properly makes me wonder...</p>
    <p>Does anyone have a clue?</p>
    <p>In the MIDlet:</p>
    protected Thread makeThread(final Particle p) { // utility
        Runnable runloop = new Runnable() {
          public void run() {
            try {
              for(;;) {
                p.move();
                canvas.repaint();
                Thread.sleep(100); // 100msec is arbitrary
            catch (InterruptedException e) {  return; }
        return new Thread(runloop);
      }<p>In the particle:</p>
    protected final Random rng = new Random();
      public synchronized void move() {
        x += rng.nextInt(step) - (step/2);
        y += rng.nextInt(step) - (step/2);
        //returns exactly the same 10 times in a row
      }

    You might try justing just one static Random object.
    Also note that als long as your using CLDC 1.0, you don't have any floating point support.

  • Comparing SQL data in the same table for two different dates

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
    Hello,
    We have a batch scheduling tool that automatically runs Oracle jobs and when it runs the jobs it stores a record from the instance in a table. I am trying to write a query that pulls up all of the jobs that ran today and compares them with what ran on the same day last week to find out what jobs didnt run today. So far I have the below but I can't get it to return anything. I am using Toad for this
    select *
    from xxcar_abat_instances
    where trunc(to_date(start_datetime)) = trunc(sysdate-7)
      and completion_status = 'Success'
    AND NOT EXISTS
      (select script_name
        from xxcar_abat_instances
       where trunc(to_date(start_datetime)) = trunc(sysdate)
         and completion_status = 'Success')Thank you

    Hi,
    964188 wrote:
    It is a date
    Such as
    10/31/2012 11:55:03 PMThen, as Hoek says, you don't want TO_DATE. For example:
    WHERE   TRUNC (start_datetime) = TRUNC (SYSDATE - 7) or the more efficient
    WHERE   start_datetime >= TRUNC (SYSDATE - 7)
    AND     start_datetime <  TRUNC (SYSDATE - 6)Also, it doesn't look like the EXISTS sub-query is corelated to the main query. That's almost certainly a mistake.
    If you're still having trouble, post your revised query, a little sample data (CREATE TABLE and INSERT statements). Point out where that query is givimg the wrong results, and explain how to get te right results.
    See the forum FAQ {message:id=9360002}

Maybe you are looking for

  • Can I upload pics from iPod touch to non apple computer

    Can i upload pics from iPod touch to non apple computer - it is a dell computer

  • Operating Concern - Transport

    Hi All, I'm trying to create a New operating concern, new characteristics and value fields in the gold client. But these customizing changes are not "automatically" collected in a transport request. Can someone tell me what is the right way to go abo

  • Encryption using gnu.crypto package

    Hello, I have a program which implements a DES algorithm for encrypting files. The program makes use of the following: gnu.crypto.Registry; gnu.crypto.Properties; gnu.crypto.util.Util; which are used in statements, for instance: -> Util.toBytesFromSt

  • Pdfs are not reading correctly

    I use indesign and illustrator CS6 and when I write a pdf my client says its showing up as funky black and white and not color. Is there something wrong with my software?

  • Internal OS 9 boot disk

    Hi, I've got me a spanking brand new second hand 533 mhz dual CPU desktop G4, digital audio Macintosh. Frankly, I'm thrilled. It works great! It has a fresh install of 10.4.6 and 9.2.2. My older machine would not boot in OS X. This new machine will b