Better to use an arbitrary primary key?

Hi all

I have an employee table where each employee has a unique employee ID. I expect to look up employees by their ID frequently. Is it better to use an arbitrary sequence as the primary key and put an index on the field ID employee or to the employee ID primary key? Thanks for your help.

Welcome to the forum!
>
Is it better to use an arbitrary sequence as the primary key and put an index on the field ID employee or to the employee ID primary key?
>
Best practice is to use surrogate keys (for example, your arbitrary sequence) rather than actual data (employee ID) for the key field values.

The main reason is that the values of data, data, maybe should be changed in the future. If you use a piece of data as the primary key and then must change any changes becomes problematic if there are references to foreign keys to it.

Another reason is that these references to foreign keys mean that the value of data is now duplicated and exist in several tables. It should be changed in any of these tables.

And business rules to deal with employee ID (or any other value of data) may change. It may be encrypted or protected against access by unauthorized persons. If ID is a primary key, because it is much more difficult to encrypt or protect the value is necessary to join the tables correctly and will therefore always available for the purpose of the request, even by people who are not allowed to access the value actually.

Never use values of actual data for values of key with the exception of the simple sample applications.

Tags: Database

Similar Questions

  • generate a numerical value to use as the primary key

    Can someone correct me, in an interview that the question was asked.

    How not one generates a numeric value to use as the primary key?

    Years

    We can get it using the sequence. For example:

    CREATE SEQUENCE cust_seq

    START BY
    1000

    INCREMENT OF
    1

    NOCACHE

    NOCYCLE;

    Hi Shu,

    sequence would be my choice and 12 c new type called identity.

  • I am trying to create a sequence to be used as a primary key in an Oracle table

    Hi guys

    I ODI version 10.3.5 and I'm trying to create a sequence that fills with row_id for a table. The schema is a database.
    And I want that this element will be the primary key of the table that is responsible to run the interface but I get questions.

    So please advise me.

    Hello

    Can you please provide the following details:
    1. What is the area of the execution of your sequence? Is it source, scene or target.
    2. what IKM you use (hopefully, you run the sequence in the staging or the target)?

    My understanding is when you check in not Null, all your lines going to the error table. So it gives no error.

    When you uncheck the not Null, it is in error because the database does not Null values in the primary key column.

    You can do the following to check if your sequence is working properly.
    Try to write an Insert Select query to DB and run it and see if it works properly.

    i.e.

    Insert (EMPL)
    EMPNO,
    ENAME,
    EMPLOYMENT,
    BISHOP.
    HIREDATE,
    SAL,
    COMM,
    DEPTNO
         
    )
    Select S_EMPNO. NEXTVAL,
    ENAME,
    EMPLOYMENT,
    BISHOP.
    HIREDATE,
    SAL,
    COMM,
    DEPTNO
         
    from EMP

    or if you can provide your query in this format, it will help find the question quickly. Please also indicate the KM.

  • Trigger - use one to create primary key values

    I'm stuck on a simple use to do a TRIGGER that fires when you add new rows to a table and want to Developer SQL to add the primary key value.

    I seem to be able to relax, but it is not inserted the primary key but giving a SQL error: ORA-00947: not enough values.

    Here's what I have.

    CREATE TABLE HF_fishers

    (

    contact_id INT NOT NULL

    , name VARCHAR (25)

    , last_name VARCHAR (35)

    PRIMARY KEY (contact_id)

    );

    CREATE SEQUENCES HF_fishers_seq.

    Then I ran the following trigger:

    CREATE

    HF_fishers_seq_trigger RELAXATION

    BEFORE INSERTING

    ON HF_fishers

    FOR EACH LINE

    BEGIN

    IF (: new.contact_id IS NULL)

    THEN

    : NEW.contact_id: = NVL (: NEW.contact_id)

    HF_fishers_seq. NEXTVAL

    );

    END IF;

    END HF_fishers_seq_trigger;

    =============

    Then I executed the following SQL statement that gives the error.

    INSERT INTO HF_fishers VALUES('Jacob','Muller');

    But if I do everything is good except that it defeats the purpose of relaxation.

    INSERT INTO HF_fishers VALUES(1,'Jacob','Muller');

    MySQL has a nice 'AUTO_INCREMENT' command, but from what I understand in Oracle, I need to set up a trigger to automatically increment a column/cell, which in this case I use for the PRIMARY KEY.

    3003916 wrote:

    OK Jaramillo, I tried as you wrote, but what would be an INSERT statement correct?

    -After the code trigger of Jaramillo

    INSERT INTO HF_fishers (first_name, last_name) values ("Jesse", "Owens"); -I have the trigger but he made the mistake of duplicate key.

    INSERT INTO HF_fishers values (hf_fishers_seq.nextval, 'Jesse', "Owens");  -No trigger but get key duplicated,.

    INSERT INTO HF_fishers VALUES(:NEW_contact_id,'Jesse','Ownes'); -works without the trigger but the "get links" dialog box appears. So not much 'automatic' on this issue,.

    My mistake.  Here is the modified version of the trigger. I removed the CONDITIONAL clause and comes to be a part of the body of the trigger.

    So, I created the table, the sequence, the relaxation and ran the first two insert statements and it worked fine.  The third one you have invites SQL + or any tool you use to enter a value if she sees the ":" colon as a variable binding.  Colon only works in a trigger without asking for confirmation.

    Here is the code and my exit I ran home

    DROP TABLE hf_fishers CASCADE CONSTRAINTS PURGE;
    DROP SEQUENCE hf_fishers_seq;
    
    CREATE TABLE hf_fishers
    (
    contact_id   INTEGER NOT NULL
    ,first_name   VARCHAR(25)
    ,last_name    VARCHAR(35)
    ,PRIMARY KEY (contact_id)
    );
    
    CREATE SEQUENCE hf_fishers_seq;
    
    CREATE OR REPLACE TRIGGER hf_fishers_seq_trigger
       BEFORE INSERT
       ON hf_fishers
       FOR EACH ROW
    BEGIN
    
       IF(:NEW.contact_id IS NULL) THEN
          :NEW.contact_id := hf_fishers_seq.NEXTVAL;
       END IF;
    
    END hf_fishers_seq_trigger;
    
    INSERT INTO hf_fishers(first_name, last_name)
         VALUES ('Jesse', 'Owens');  -- Works with the trigger
    
    INSERT INTO hf_fishers
         VALUES (hf_fishers_seq.nextval, 'Jesse', 'Owens');  --Works without using the trigger body code.
    
    SELECT *
      FROM hf_fishers;
    
    COMMIT;
    

    The output

    Deleted table.

    Elapsed time: 00:00:00.05

    Sequence has fallen.

    Elapsed time: 00:00:00.02

    Table created.

    Elapsed time: 00:00:00.03

    Order of creation.

    Elapsed time: 00:00:00.02

    Trigger created.

    Elapsed time: 00:00:01.05

    1 line of creation.

    Elapsed time: 00:00:00.04

    1 line of creation.

    Elapsed time: 00:00:00.01

    CONTACT_ID FIRST NAME LAST NAME

    ---------- ------------------------- -----------------------------------

    1 Jesse Owens

    2 Jesse Owens

    2 selected lines.

    Elapsed time: 00:00:00.04

    Validation complete.

    Elapsed time: 00:00:00.01

  • Synthetic Primary Key (sequence number) vs natural primary key

    I wonder if the sequence number is better than the primary key. I found a few tables only use the sequence number, some tables use the primary key only, and a few tables use both. Can someone give me a clue, one that I use when you create a table? TX in advance.

    Published by: 1B, 3 may 2012 21:07

    I'm not sure I understand the question. I do not understand how it is either / or question.

    Virtually every table must have a primary key. You can either use a primary key natural (something in the data that is unique and immutable) or you would use a synthetic primary key which is filled from a sequence. I strongly suggest using synthetic primary keys generated from a sequence for your primary key.

    Justin

  • primary key of a synonym in Oracle

    Can we all know how I can describe a table to get the table structure and relationships. Relationships in the sense which column is used as a primary key and a foreign key in a particular table.

    DESC table provides details of the column. I executed under query, but it gives only the following points.

    award_reason / / DESC

    Name of Type Null

    --------------- -------- ------------

    AWARD_REASON_ID NOT NULL NUMBER (11)

    REASON_TYP NOT NULL VARCHAR2 (35)

    SORT_ORDR NOT NULL NUMBER (2)

    ASSETS NOT NULL NUMBER (1)

    Here 'award_reason' is a synonym.

    Can someone help me on this please.

    Here is a list of dictionary tables which have details on CONSTRAINTS.

    SQL > select table_name dictionary where table_name like ' % CONSTRAINT % ';

    TABLE-NAME
    ------------------------------
    DBA_CONSTRAINTS
    DBA_IAS_CONSTRAINT_EXP
    ALL_CONSTRAINTS
    USER_CONSTRAINTS

    SQL > select table_name dictionary where table_name like 'CONS\_COL% %' escape ' \';

    TABLE-NAME
    ------------------------------
    DBA_CONS_COLUMNS
    ALL_CONS_COLUMNS
    USER_CONS_COLUMNS

  • Add primary key constraint

    What will happen if I do this?

    ALTER table emp
    Add primart key (employee_id, last_name);

    It's going to be two primary keys in the table?
    or what?

    987018 wrote:
    What will happen if I do this?

    ALTER table emp
    Add primart key (employee_id, last_name);

    It's going to be two primary keys in the table?
    or what?

    It will come with an error, unless you change "primart' primary '.

    If you do, you'll get a primary key that requires a combination of the two columns to be unique.

    So, you can insert two rows with the same id of employee but different names! Not a good idea.

    Simply use a code that is used as the primary key.

    Note: you can have only one primary key for a table, but you can have many unique constraints.

  • Problem with the primary key and indexes

    Hi all

    I'm looking a mess on one of our main tables.
    One of the developers here added an index on 3 columns in the table, thinking that it would speed up (not noticing that it had not a PK).

    Subsequently another developer has noticed there do not have a primary on key. So they added a touch of primry on the single column.

    The problem is that now the index created on 3 columns is bein used as the primary key index. As when the primary key is created a new index was not created.

    Is there anyway to get rid of this index/change it correct?

    This table is related to many many other tables, so when we tried to remove the index we could not due to the primary key and foreign key violations with other tables.

    Thanks in advance

    Oracle, as you found, is quite capable to use a column enformce multi index a single column primary key, as long as the pk column is the leader in the index. This should not cause performance issues for a search of PK and if the three indexed columns are often selected only may benefit from these types of queries.

    The only way to change that now, would be to drop all CF, drop and add the PK constraint and then add all the FK constraints. A long time and potentially dangerous (if you miss to add back of the FKs) endeavour. Certainly not worth the risk in my opinion.

    John

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • Performance problem on the SQL query that does not use the primary key index

    Hello!

    I have some performance issues on a single SQL query (Oracle 10 g).
    I could solve the problem by using the INDEX indicator, but I would like to know WHY this is happening.

    * Tables *.
    create table jobs)
    ID number (5) not null,
    name varchar2 (100),
    primary key constraint Job_PK (id)
    )
    /
    -Record count: 298

    create table Comp)
    integer ID not null,
    name varchar2 (100),
    primary key constraint Comp_PK (id)
    )
    /
    -Record count: 193

    -Relation m: n
    create table JobComp)
    integer ID not null,
    id_job integer not null,
    id_comp integer not null,
    primary key constraint JobComp_PK (id),
    unique key constraint JobComp_UK (id_job, id_comp),
    Constraint JobComp_FK_Job foreign key (id_job) refers to Job (id),
    Constraint JobComp_FK_Comp foreign key (id_comp) makes reference Comp (id)
    )
    /
    create index JobComp_IX_Comp on JobComp (Cod_Comp)
    /
    create index JobComp_IX_Job on JobComp (Cod_Job)
    /
    -Record count: 6431

    * Ask *.

    When I run this query, the execution plan shows the index using (JobComp_PK and JobComp_IX_Comp).
    No problem.

    Select JobComp.*
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    But when I add the field 'name' of the work table the plan uses full access table to the table of work

    Select JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in the 2.70 dry

    With the help of the index

    Select / * + INDEX (Job Job_PK) * /.
    JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    * Doubt *.

    This behavior is correct?

    PS. : I tried to recalculate the statistics, but nothing changes:

    analyze the job calculation table statistics.
    /
    change the statistical calculation of index Job_PK reconstruction;
    /
    Start
    dbms_utility.analyze_schema (sys_context ('userenv', 'current_schema'), 'CALCULATE');
    end;
    /

    [of]
    Gustavo Ehrhardt

    Gus.EHR wrote:
    Hello.
    I'm sorry for the plan unformatted.
    The execution time of the querys "without field name' and 'with the field name with suspicion" are equal.
    He has no problem caching, because I get the plans of the sequence different from the querys and repeated the performance. The result is always the same.

    I don't think that there is no problem with oracle crossing LOOP IMBRIQUEE to the HASH JOIN when you include the field name and this should be the expected behavior. But it seems that your WORKING table has a degree of parallelism set against what is causing the query to run in parallel (as JOB table is now available with full table scan, instead of indexed access earlier). It could be that the parallel execution is contributor to extra Runtime.
    (a) do you know why the degree of parallelism on the WORK table has been defined? Do you need it?

    You can see if the following query provides a better response time?

    select /*+ NOPARALLEL(JOB) */ JobComp.*, Job.Name
      from JobComp
      join Job
        on Job.id = JobComp.id_job
     where JobComp.id_comp = 134
    
  • creating a unique index of instaed of using the primary key index

    Hello

    I heard in a debate sometimes it is better to create a unique index on a column and use it instead of using the primary key index in oracle. I did not understand what that the reason propely.

    Can someone please help me in this topic if it is valid.

    Thanks in advance

    On the surface, which does not seem reasonable... Volume of the DML is irrelevent to determine which column is the primary key for a table.

    My wild speculation a bit at a reasonable time could someone do...

    If you use synthetic primary keys (i.e. the keys generated by sequence) and that your tables are subject to large volumes of inserts such as there is a danger that the block "to the right" will be the source of contention block and worry not about analysis of beach on the column, you can create a reverse on this column (unique or non-unique) key index before creating the primary key constraint and to indicate Oracle to use this existing index to respect the primary key constraint.

    Obviously, however, this involves a lot of assumptions to arrive at a reasonable point. There may well be another set of assumptions that could also lead to a valid argument. Or it could be a myth that someone has heard and just repeats.

    Justin

  • How to create the validation for a composite primary key feature when I use create with operation of parameters to pass values to a page (i.e. the ADF table) to another page I get this error, how can I solve it. Please help me any one ASAP?

    Hello

    I have a page with adf faces table, I need to pass values to the table to another the inputfields page (both fields are composite primary keys), I'm passing values but I get the error while I'm passing values twice on the next page with a button command (using setPropertyListener) this error... Please help me?

    Houston-29114 ADFContext is not configured to process this exception messages. Use the code of exception stack trace and error to investigate the root cause of this exception. Root cause error code is Houston-25013. Error messages settings are {0 = oracle.jbo.Key [22 9]}

    ADF_FACES-60097: for more information, see the error log of the server for an entry beginning with: ADF_FACES - Exception during the PPR, #1 60096:Server


    The error log is...


    URL - target http://127.0.0.1:7101/Recruting-ViewController-context-root/faces/login.JSPX

    < ViewHandlerImpl > < _checkTimestamp > Apache Trinidad runs with control of activated timestamp. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml

    < UIXEditableValue > < _isBeanValidationAvailable > Validation Bean A provider is not present, so bean validation is disabled

    passing the user name: 201157

    < _LogUnhandledException > ADF_FACES - 60098:Faces life cycle receives exceptions that are unhandled in phase 5 of INVOKE_APPLICATION

    oracle.jbo.TooManyObjectsException: Houston-25013: too many objects correspond to the oracle.jbo.Key [22 primary key 9].

    at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:608)

    at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:617)

    at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1030)

    at oracle.jbo.server.EntityCache.add(EntityCache.java:541)

    at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1141)

    at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1140)

    at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:461)

    at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:478)

    at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5800)

    at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1941)

    at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2504)

    at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2545)

    at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2510)

    at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11133)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1342)

    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)

    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)

    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)

    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at com.sun.el.parser.AstValue.invoke (unknown Source)

    at com.sun.el.MethodExpressionImpl.invoke (unknown Source)

    at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:173)

    at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:163)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1091)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:982)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:880)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:553)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:158)

    at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:115)

    at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:84)

    at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:50)

    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)

    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)

    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)

    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)

    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)

    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)

    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)

    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)

    at java.security.AccessController.doPrivileged (Native Method)

    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)

    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)

    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)

    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)

    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)

    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)

    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)

    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    < RegistrationConfigurator > < handleError > ADF_FACES - 60096:Server Exception during the PPR, #1

    oracle.jbo.TooManyObjectsException: Houston-29114 ADFContext is not configured to process this exception messages. Use the code of exception stack trace and error to investigate the root cause of this exception. Root cause error code is Houston-25013. Error messages settings are {0 = oracle.jbo.Key [22 9]}

    at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:608)

    at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:617)

    at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1030)

    at oracle.jbo.server.EntityCache.add(EntityCache.java:541)

    at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1141)

    at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1140)

    at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:461)

    at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:478)

    at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5800)

    at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1941)

    at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2504)

    at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2545)

    at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2510)

    at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11133)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1342)

    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)

    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)

    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)

    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at com.sun.el.parser.AstValue.invoke (unknown Source)

    at com.sun.el.MethodExpressionImpl.invoke (unknown Source)

    at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:173)

    at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:163)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1091)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:982)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:880)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:553)

    at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:158)

    at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:115)

    at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:84)

    at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:50)

    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)

    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)

    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)

    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)

    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)

    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)

    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)

    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)

    at java.security.AccessController.doPrivileged (Native Method)

    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)

    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)

    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)

    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)

    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)

    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)

    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)

    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    Hi all, finally I found the solution to this exception.

    I did the following steps to solve the problem.

    1. create a bean and use this method

    public void tooManyObjectsMatchExceptioHandeler() {}

    Add the code in the event here...

    System.out.println ("inside the Handeler");

    FacesMessage message =

    new FacesMessage ("Type your friendly message");

    message.setSeverity (FacesMessage.SEVERITY_ERROR);

    FacesContext fc = FacesContext.getCurrentInstance ();

    fc.addMessage (null, message);

    }

    Now, drag and drop the file above java projects in data controls in the browser of the application.

    2. drag a workflow method call (where u get exception as Houston-25013) and call this method as an activity of the exception handler,

    Now, do a right click on this--> definition of the page method call create or go to definition of the page--> create a link Action method and select the above method in the select and file def page this method call in the workflow then go to properties inspector set out fixed property (here name of activities of method call) u give.

  • Order columns (which make up the primary key constraint) matter in where clause of DML query for use of indexing mechanism to operate.

    Version of DB: database Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production


    I have a table my_table as below:
    create table my_table
    (
    my_code varchar2 (6).
    my_id varchar2 (24).
    forced pk_1 primary key (my_code, my_id)
    );


    Primary_key here's a composite key that contains columns 1 (my_code) and 2 (my_id).
    Is there that a difference in the way below queries is executed in terms of performance (use of indexing in the extraction).

    (a) select * from my_table where my_code = '123' and my_id = "456";
    (b) select * from my_table where my_id = '456' and my_code = '123';


    The understanding I have the order of the column in the where clause should be identical to the sequence in
    What primary key draws for indexing to be used by oracle in oracle other DML queries ignores indexing
    However when I used explain plain both show the same query cost with single scan with index rowid.
    so I don't know if I'm wrong in the concept that I have. Kindly help.

    Thanks in advance,
    Gerard

    Your question is answered in the Performance Tuning Guide

    Using indexes and clusters

    14.1.4 choosing composite indexes

    A composite index contains several key columns. Composite indexes can provide additional benefits compared to the index to single column:

    • Improved selectivity

      Sometimes the two or more columns or expressions, each with a low selectivity can be combined to form a composite with a high selectivity.

    • Reduced IO

      If all columns selected by a query are a composite index, then Oracle may return these values in the index without access to the table.

    A SQL statement can use a path on a composite index if the statement contains constructions that use a main part of the index.

    Note:

    This is no longer the case with the skip index scans. See "Index Skip Scans".

    A main part of an index is a set of one or more columns that have been specified first and consecutively in the list of columns in the CREATE INDEX statement that created the index.

  • How to extract the values of the line full in the bean to support using the primary key

    Hello

    I have a table that has columns as plant_name, business planner email id and identification of email resident engineer. Here, Plant_name is the primary key.

    Now, I have this plant's name slipped and dropped like selectonechoice (drop) on page jsff. In this user can select any name of 1 plant drop down.

    Right now, I can go get plant in backing bean name, but I can't understand how business plan for extraction and identification of email of the engineer resident in this key primary-plant_name at the bean to support.

    Please let me know if anyone has an idea in this regard.

    JDeveloper version 11.1.1.6.0

    Thanks in advance.

    Sneha

    Sneha211 wrote:

    On the jsff page

    required = "#{bindings." Plant.hints.Mandatory}.

    shortDesc = "#{bindings." Plant.hints.ToolTip}.

    ID = "soc1" unselectedLabel = "- Select -"

    autoSubmit = 'true '.

    Binding = "#{backingBeanScope.backingbean.plantbean}" > "

    ID = "si1" / >

    In backing bean

    DCBindingContainer = lBindingContainer

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding lBinding = lBindingContainer.findIteratorBinding("SupplierVO1Iterator");

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    Hi Sneha, you've written code for it

    you have found the current line and the primary key then this line, then why you not not using this same rank to get the other attributes?

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    String businessPalnner = (String) newRow.getAttribute ("business_planner"); Returns the value of the same line

    Engineer in String = (String) newRow.getAttribute ("engineer");


    OR if your condition is like that-

    you have a primary key field value, but you do not have the corresponding line, then you can get that line and it's attribute by using the primary key value

    See - http://adfgouravtkiet.blogspot.in/2012/10/filtering-of-data-from-vo.html

    Hope it helps

    -Ashish

  • is it better to use the rowid function or a composite key

    I have a clue about 2 fields so that I can make my form based on these 2 fields
    But now since I spend my app in 4.2 that I intend to do everything depended of rowid function

    Is this the right approach
    I currently facing problems as 1422 extract extract several lines even if the primary key is defined as key composite column 2

    Your primary key must never rest on 'natural touches', that is to say the actual data in your table. The fact that you are talking about a composite key means that you think that do. You can create an index that is UNIQUE on these types of fields to maintain the integrity of the data, but they do not have the pharmacokinetics of the table.

    My primary keys are always a NUMERIC field, populated by a combination of sequence/relaxation. Because the data in the ID field have no connection with the data in the table - there is never any need/reason to change. As has been mentioned above, ROWID changes rarely, but it is possible for them. I use ROWID in the Apex and when I have forms to keep tiny (maybe 5-10 lines) lookup tables that are used to populate LOVs create a primary key is excessive.

Maybe you are looking for

  • How to protect your computer from viruses?

    Admitted to the site, I want to see him show me the presence of virus and infect the machine Can Firefox avoid this? Thank you

  • BT still connected

    I use the Toshiba Bluetooth stack to connect to a wireless printer. I can pair it with the printer very well, but need a way to have this device always connected without having to click on the printer and select Connect. Is there a way to automate th

  • Problems with sound and Audio - realtek hd audio is not compatible for the audio device

    I use Windows XPand receives my sound and audio to work, I got a lot of response to this problem, but not the right answers, I got my sound set correctly but my audio does not work. In my default audio device is defined as realtek hd audio that is no

  • Windows 7 black screen with cursor (without flashing) to start in normal mode or safe. HELP PLEASE!

    Yesterday, I was using my computer and it locked up, so I turned off the power and the reboot. When I did this went to a system startup repair screen and said that no problem was detected on windows startup. However, I always get a black with a curso

  • Creative cloud is empty

    I have searched the forums and can't find a way to fix this problem.  I'm on a Mac and when I click on the CC icon, it opens a blank window.  The window is completely empty and doesn't even say creative cloud.  I tried to follow the steps to solve th