Querying on the basis of some attribute of composite primary key

Hello,
I am looking for suggestion about querying just on the basis of one attribute of the composite primary key.
TO exemplify,
I have a 6 attributes example A1,A2,A3,A4,A5,A6.
A1,A2 and A3 together, serve as composite primary key.Now,because of the need of the project,I want to do querying on the basis of any A1,A2 or A3.One way I could think of is to have secondary indices on each of A1,A2,A3.
Can some one explain me roughly how to go about it?
I am a new user of BerkeleyDB Java Edition,hence not sure what would be a good way to do it.I understand one way to do it,would be to keep A1,A2,A3 in the Key class and A1,A2,A3,A4,A5,A6 in the value class as well.Then create secondary indices on the A1,A2 and A3 individually.
Can someone suggest a more efficient way?
Thanks,
Will appreciate any suggestions.
Prateek

Exactly as you said. Create secondary indices on each attribute you want to index off of. I don't use the Java interface, but what you pretty much need to do is form your secondary key like so:
skey: pkey_individual_attribute
skeysize: pkey_individual_attribute_sizeHow to do this is documented in the BDB Java API docs:
For example:
    class MyKeyCreator implements SecondaryKeyCreator {
        public boolean createSecondaryKey(SecondaryDatabase secondary,
                                            DatabaseEntry key,
                                            DatabaseEntry data,
                                            DatabaseEntry result)
            throws DatabaseException {
            // DO HERE: Extract the secondary key from the primary key and
            // data, and set the secondary key into the result parameter.
            return true;
    SecondaryConfig secConfig = new SecondaryConfig();
    secConfig.setKeyCreator(new MyKeyCreator());
    // Now pass secConfig to Environment.openSecondaryDatabaseThe extractor function used to construct the secondary index is passed the primary key and primary data - therefore all the data is available to you with no need to duplicate the key within the data itself. While the standard example is to use some part of the primary data to form a secondary key - there's absolutely nothing against using only a part of the primary key to form a secondary key instead. The only thing you have to do is slice up said primary key and construct the "result" parameter to be a single attribute. The backend API already knows which composite key this secondary entry will be associated with and as such will implicitly form the data (or as you called it "value") section of the index (which will be the composite primary key passed to it).
The primary key/data should consist of the composite A1,A2,A3 with only A4,A5,A6 as data.
The secondary->get() call (within the Java API) takes a key and provides back the primary key and primary data (basically the same as the db->pget() call in the C API). Since you've already indexed individual attributes, based off of the composite key, into their own respective databases - you just query from one of your secondary indexes with whatever specific attribute as the key. You then use the filled in primary key and primary data to work off of.

Similar Messages

  • How to set two attributes as  a primary key in database ?

    how to set two attributes as a primary key?
    Take COffeesbreak as an example ,
    let's suppose that there are cof_name ,sup_id,price and so on;
    the same cof_name may be suplied by more sup_ids,
    and one sup_id may suply more cof_names.
    so the Primary key should be set the cof_name and sup_id ,
    how to set ?
    (of course that i konw if I set a cof_id,the problem will be easy work out
    but now there are those like above)
    I set that as following:
    create table coffees (cof_name VARCHAR(32) PRIMARY KEY,sup_id INTEGER, PRIMARY KEY,PRICE INTEGER )
    THE database print error :cant add more primary keys!
    thanks in advance

    You can only use the PRIMARY KEY declaration on a column if it is the only Primary Key column.
    Use the PRIMARY KEY constraint statement instead.
    create table coffees (
      cof_name VARCHAR(32),
      sup_id INTEGER,  
      PRICE INTEGER,
      PRIMARY KEY ( cof_name ,sup_id )
    )Dave

  • How to Alter any table to make some fields Composite Primary Key

    I need to Alter Table to make some fields Composite Primary Key.
    Is it possible to do this ?
    Please give any example.
    Regards,
    AgrawalV

    Agrawal
    If you are looking for an example to create a composite primary key, here you are.
    sql> Alter Table myTable add constraint pk_myTable primary key(col1, col2, ...coln) ;
    where
    pk_myTable is the name of the primary key constraint,
    myTable is the name of the table that you want to create a constraint on and
    col1...coln are the column names in the table <myTable)

  • The column in the table do not match an existing primary key

    I've got two tables tbl_Workshop and tbl_Material
    tbl_Workshop has columns workshopID, workshopTitle, materialID
    tbl_Material has materialID, name, workshopTitle
    when I'm trying to create a relationship between the workshopTitle of tbl1 and tbl2, it gives me an error that says the column in the table do not match an existing primary key.
    What could be the reason for this error and how to overcome it.
    ps. The datatypes and names of both the table's column match.

    Have you created primary key on workshopTitle column in tbl_Workshop
    You can add foreign key relationship from tbl_Material.workshopTitle
    to tbl_Workshop.workshopTitle
     only if latter is a primary key of the table.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How do i show a popup in an OA Pageon the basis of some database validation

    Hi All
    I need to show a popup message on the click of a button.
    On the click of the button I have to submit the page and do some database validation with the data entered by the user on that page.
    Depending on the validation I have to give a popup which will have a value that is fetched from tha database.
    I can show a popup by writing the below given code in the processRequest of my CO
    OASubmitButtonBean registerbutton = (OASubmitButtonBean)oawebbean.findChildRecursive("RegisterButton");
    registerbutton.setOnClick("alert('show an alert')");
    But I cannot perform the database validation(using a stored procedure) in the processRequest.
    I am performing the validation in the processFormRequest
    Also I am not able to show the value fetched from the database in the popup using the above alert.
    Please send me the code.
    Thanks in advance.
    Regards
    Meenal

    okay so the popup window would be some information window, where the user, maybe after reviewing the information presses close and closes the window.
    i would do this using PPR, have a small content region or some other small region(which supports PPR), which would showup in some section of the screen when the user performs the desired action, and have a close button in the region, pressing close would fire PPR again and hide this region.
    There maybe variety of solutions such as this depending on the requirement.
    Thanks
    Tapash

  • Entity Impl find by attribute value (not primary key)

    Hello to all!
    In database there are three tables: users (userId, userName), groups (groupId, groupName) and link (linkId, userId, groupId) - this table uses for "many to many" connection.
    In application i created entitys and associations for each table.
    Also override remove method for users and groups (now if delete user or group all rows associated with them will be deleted from link table).
    Now what i want to do - if new user were added, then add new row to link table with new user id and group id which groupName equals guest.
    Can it be done on entity level? If yes - how?
    Sorry for my language.

    I can think of a few ways to do this. One approach for your Users EO generate the relating EntityImpl (UsersImpl) with the create() method, and add the following code:
    protected void create(AttributeList attributeList) {
      super.create(attributeList);
      SequenceImpl userIdSeq = new SequenceImpl("USER_ID_SEQ",getDBTransaction());
      setUserId(userIdSeq, userIdSeq.getSequenceNumber());
      LinksImpl link = createLink(getUserId());
    public LinksImpl createLink(Number userId) {
       LinksDefImpl linksDefImpl = (LinksDefImpl)LinksImpl.getDefinitionObject();
       LinksImpl newLink = (LinksImpl)linksDefImpl.createInstance2(this.getDBTransaction(), null);
       newLink.setLinkId(1000);
       newLink.setUserId(userId);
       newLink.setGroupId(1); // assuming 1 is the "Guest" group
       return newLink;
    }This will create the Links record straight after the Users record is created. It assumes the Groups "Guest" record already exists.
    CM.

  • Can the Primary Key also be Primary key in another table

    Hi all,
    I am working on a project. The project specification says:
    Project table contains details of projects and the project number *(proj_no)* is the key.
    project ( proj_no , proj_date, proj_desc, proj_type, proj_status, s_no, cust_no)
    purchase_order table contains details of the purchase orders for each project and the combination of project
    number and a purchase order number *(proj_no, po_no) form the key.*
    purchase_order ( proj_no , po_no, po_date)
    How can I have proj_no in the project table and in the purchase_order as primary keys?
    If I create a composite key in the purchase_order table making the ( proj_no, po_no) as primary key. How can I make the project_no in the project table a primary key too?
    Is there a solution for it?
    CREATE TABLE purchase_order(
    po_no NUMBER(5) NOT NULL,
    proj_no NUMBER(5) NOT NULL,
    po_date date,
    CONSTRAINT p_o_po_no_proj_no_pk PRIMARY KEY (po_no,proj_no));
    Thanks!!!

    Hi,
    I think I'd set the project no in the projects table a primary key, and project no in the purchase orders table a foreign key constraint to the projects table, combined with a unique, not null constraint in the table.
    That, in addition to a unique, not null constraint on the purchase orders column, and a composite primary key should fulfill the requirements.
    Best of luck!
    Johan

  • To fetch data on the basis of last program run date and time

    Hi all,
    My query is as folows:
    I am selecting BOM components from STPO table on the basis of some criteria.
    My requirement is to select only BOM components which are newly added or created after last program run,i.e. STPO-AEDAT and STPO-ANDAT are greater than last program run.Here i fetched last program date from customised structure(client specific) which has date field also,and compared with aedat and andat in STPO records.But how can I connect it with last run time as there is no such time field in STPO table.I need to fetch this data on the basis of last program run(time+date).
    Please help me..it's crucial,
    Thanks in advance,
    Meena

    Hi,
    We had a very similar requirement.
    We developed a custom-solution for this.
    Create a Z-Table and update it with your progname, date and time.
    Whenever the BOM was changed, it generated a change number ( this has to be done by the user)
    You can get the date and time from the change Number Table AENR and compare it with the timestamp in Z-TABLE
    Hope it helps,
    RJ

  • Is there any restriction on the length of all Primary keys in a table

    Hi all,
    Is there any restriction on the length of all Primary keys in a data base table?
    i have some 10 fields as primary key in a DB table and length exceeds 120 and getting a warning.
    Please let me know will there be any problems in future with respect to the same?
    With regards,
    Sumanth

    Well actually there are constraints like
    Total of internal lengths of all primary key columns        1024 Bytes
    Number of primary key columns per table                     512
    For other information about SAP database please refer to http://sapdb.org/sap_db_features.htm  
    Thanks & Regards,
    Vivek Gaur
    Alwayz in high spirits

  • Too many objects match the primary key

    Hi,
    I have created a view object based on entity wich has two attributes as a primary key. I have no problems to insert a new record, the problem is that the table(based on the view) is not refreshing even though it has a partial trigger of the button that invokes the create record.
    After the new record is created I call an action binding to execute the query and I got the error Too many objects match the primary key. So how can I refresh the table after inserting?. I also have jbo.locking.mode="optimistic" in the application module.

    I changed my code to :
    Row row = this.createRow();
    row.setAttribute("Gesdcodarea",codigoArea); // value:2
    row.setAttribute("Gesdcodrol",codigoRol); // value:19
    row.setAttribute("Gesdusrreg",usrRegistra);
    row.setAttribute("Gesdroltip",tipoRol);
    try {
    this.insertRow(row);
    this.getDBTransaction().commit();
    resultado = 1;
    } catch (Exception e) {
    logg.log(Level.SEVERE, "Error al registrar rol y area por usuario", e);
    and I get the error " JBO-27023 Failed to validate all rows"
    ## Detail 0 ##
    oracle.jbo.RowValException: JBO-27024: Failed to validate a row with key oracle.jbo.Key[2 null ] in EOGesdarearol.
    Caused by: oracle.jbo.AttrSetValException: JBO-27025: Failed to validate the attribute Gesdcodrol with the value 19
    Caused by: oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[2 19 ].
    Edited by: Miguel Angel on 19/09/2012 06:24 PM
    Edited by: Miguel Angel on 19/09/2012 06:26 PM

  • Unable to understand the concept of Primary Key in EJB

    hi,
    please help me in understanding the concept of Primary Key.
    For each and every entity bean represents a data base row. i think it is correct. if multiple users are accessing the same data base row, there will be different primary key for each and every client. is it correct or not. can we say this as "concurrency"?. if all the clients are manipulating the bean, who manages it either application server or data base server?. why does we must implement both hashCode() and equals() methods?. Provide me the links where i can find the answers.

    if multiple users are
    accessing the same data base row, there will be
    different primary key for each and every client.This is incorrect: the PrimaryKey is the unique identifier for each database row. It has nothing to do with users. In order for CMP to work, the container must be able to operate with a single row in the database and be able to distinquish between them.
    If your CMP->database table already has one column that's unique, then you declare that CMP field to be <primary-key-field>. If you have more than one column that makes a row unique, you must make your own primary key object. The way the container can tell the difference between these primary key objects is to compare them, therefore the hashCode and equals methods.
    Provide me the links where i can find the
    answers.This is all discusssed in the J2EE Tutorial.

  • Insert values in multiple tables. One of the tables has complex primary key.

    Hello, I am using Jdeveloper version 11.1.2.3.0
    I have a table FORM_TYPE and another table Str. The Str table is used to translate strings from the table name which are read from another program from the database and used to generate forms..
    The FORM_TYPE  table has a relation to the STR table via formtype.title_str_id = str.str_id.
    The STR table has a primary key that is depending on mf_language and str_id columns. I generated entity for the STR table but can't insert from the application module new values for some reason... It says the record invalidates its own entity..
    I am trying to create a table that will be editable and will have the columns Description, Name, Str in English, Str in French etc...
    Want to create a Form_Type and in the same time to insert new values for each language... But can't make the inserts of the new STR work..
    Also the    FormType.TITLE_STR_ID has many values null already in the database.
    SELECT FormType.DESCRIPTION,
           FormType.FORM_TYPE_ID,       
           FormType.NAME,
           FormType.PAPER_REPORT_FORMAT,
           FormType.PAPER_REPORT_NAME,
           FormType.TITLE_STR_ID,
           en.str en_str,
           en.str_id,
           en.object_name en_object_name,
           fr.str,
           fr.str_id,
           fr.object_name,
           du.str,
           du.str_id,
           du.object_name,
           bg.str,
           bg.str_id,
           bg.object_name      
    FROM FORM_TYPE FormType,
    (select str.str_id, str.mf_language_id, str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='en') en
      , (select str.str_id, str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='fr') fr,
      (select  str.str_id,   str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='du') du,
      (select  str.str_id,  str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='bg') bg
    WHERE
    formtype.title_str_id = en.str_id and
    formtype.title_str_id = fr.str_id and
    formtype.title_str_id = du.str_id and
    formtype.title_str_id = bg.str_id  

    Tried that I made view links and associations but still can't insert in both tables at once... Could be because the tables aren't having relationship between them or because the STR table has a (STR_ID, MF_LANGUAGE_ID) primary key...

  • REFRENCEING PRIMARY KEY IN THE TABLE

    Hi,
    I want to refer the composite primary key column into one table that is i have one primary key with three columns and i want to refer only one column as a forigen key in the other table.
    how do i do that ?
    regards
    gaurav
    null

    Foreign keys have to map to primary keys. If your master table requires three columns to uniquely identify a record then its children must have those three columns as well. This can lead to the apparently absurd situation where you have tables whose keys consist of more columns than the actual table data.
    The alternative is to use an artificial ID column as the PK and make the other columns an unique key. The problem with synthetic primary keys is that it makes it difficult to identify children or grandchildren: you always have to join with the parent table or denormalise your data.
    Example: ORDERS identified by Ord_No
    ORDER_ITEMS identified by ord_itm_no
    Natural key: ORDERS PK = order_no
    ORDER_ITEMS PK = order_no
    , ord_itm_no
    Here it is easy enough to find which items belong to Order 1234 just by querying ORDER_ITEMS table.
    Synthetic key: ORDERS PK = id
    UK = order_no
    ORDER_ITEMS PK = ORDERS.id, id
    UK = order_no, ord_itm_no
    Here to find which items belong to Order 1234 you have to query ORDERS to find the ID before querying ORDER_ITEMS table. You have to have triggers on the ORDER_ITEMS table to populate the denormalised columns order_no and ord_item_no.
    Which approach you take ought to depend upon your database and what you do with it but it take on the flavour of a religious war. The orthodox view (the word of Codd) firmly supports using natural keys.
    ciao, APC

  • Error When Trying to add more attribute to primary key

    I have a problem that I have an editable table that is mapped to view object
    this view object is mapped to singe Entity Object.
    My Entity Object has composite primary key the primary key composed from two attributes.
    but now I tried to change the primary key to make it composed from tree attributes that I tried to make one more attribute as primary key .
    when know I try to run the form this error appear
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    java.lang.ArrayIndexOutOfBoundsException: 0
         at oracle.adf.model.binding.DCIteratorBinding.reserveRowWithKey(DCIteratorBinding.java:3857)
         at oracle.jbo.uicli.binding.JUIteratorBinding.reserveRowWithKey(JUIteratorBinding.java:483)
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.setupRegionIteratorBinding(JUCtrlHierNodeBinding.java:2128)
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.getRegionBinding(JUCtrlHierNodeBinding.java:2054)
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.getBindings(JUCtrlHierNodeBinding.java:1933)
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.internalGet(JUCtrlHierNodeBinding.java:1528)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding.internalGet(FacesCtrlHierNodeBinding.java:119)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:750)
         at oracle.adfinternal.view.faces.model.HierNodeBindingELResolver.getValue(HierNodeBindingELResolver.java:52)
         at oracle.adfinternal.view.faces.model.AdfELResolver.getValue(AdfELResolver.java:86)
         at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
         at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:82)
         at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:126)
         at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:230)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:481)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:411)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:116)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:334)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.renderDataCell(BaseColumnRenderer.java:1213)
         at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.encodeAll(BaseColumnRenderer.java:103)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.renderDataBlockRows(TableRenderer.java:1932)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer._renderSingleDataBlock(TableRenderer.java:1601)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer._handleDataFetch(TableRenderer.java:1003)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:504)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:529)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1515)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:785)
         at oracle.adfinternal.view.faces.util.rich.InvokeOnComponentUtils$EncodeChildVisitCallback.visit(InvokeOnComponentUtils.java:113)
         at org.apache.myfaces.trinidadinternal.context.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:222)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:378)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:326)
         at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:443)
         at oracle.adfinternal.view.faces.util.rich.InvokeOnComponentUtils.renderChild(InvokeOnComponentUtils.java:43)
         at oracle.adfinternal.view.faces.streaming.StreamingDataManager._pprComponent(StreamingDataManager.java:611)
         at oracle.adfinternal.view.faces.streaming.StreamingDataManager.execute(StreamingDataManager.java:460)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer._encodeStreamingResponse(DocumentRenderer.java:3200)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1245)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1515)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:785)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
         at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:710)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at 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:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.egabi.mcit.utils.SecurityFilter.doFilter(SecurityFilter.java:78)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         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)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)I didn't change any thing in the page only tried to add new attribute to be primary key
    when I mark this attribute in the entity as primary key .
    this error appear
    when I remove it the page run with no problem.
    The model run with no problem
    What is the problem about this.

    Do I get you right that you have changes the pk of the EO successfully and you see the error when running the app with the changed EO?
    Have you checked if the change of the PK was distributed to the VO too?
    Sometimes it helps to remove the component bound to the VO in question from the page and put it back on again.
    Timo

  • Primary Key Violation at the time of Moving from primary range to secondary range.

    Hi Experts,
    I've observed a strange issue in our environment.
    we are using sql server 2008 R2 with SP2.
    whenever a table is moving from primary range to secondary range on it's identity values, application is getting crashed with the message as below. 
    Violation of PRIMARY KEY constraint 'PK6'. Cannot insert duplicate key in object 'dbo.TD_TRANN'. The duplicate key value is (17868679).
    The statement has been terminated.
    OR
    Violation of UNIQUE KEY constraint 'IX_TDS_COST'. Cannot insert duplicate key in object 'dbo.TDS_COST'. The duplicate key value is (17, 19431201).
    identity ranges were auto managed by replication. agents are running continuous.
    please suggest.
    Cheers, Vinod Mallolu

    Well this is pretty simple, so there are two type of subscriptions (Server and client) in merge replication. So while adding article you provide following parameters:
    @pub_identity_range
    @identity_range
    You can check the details of above parameters on following article:http://msdn.microsoft.com/en-us/library/ms174329.aspx
    Snippet
     @pub_identity_range= ]
    pub_identity_range              
    Controls the identity range size allocated to a Subscriber with a server subscription when automatic identity range management is used. This identity range is reserved for a republishing Subscriber to allocate to its own Subscribers.
    pub_identity_range is bigint, with a default of NULL. You must specify this parameter if
    identityrangemanagementoption is auto or if
    auto_identity_range is true.
    [ @identity_range= ]
    identity_range              
    Controls the identity range size allocated both to the Publisher and to the Subscriber when automatic identity range management is used.
    identity_range is bigint, with a default of NULL. You must specify this parameter if
    identityrangemanagementoption is auto or if
    auto_identity_range is true.
    So for example you are adding "Server" type subscription then we consider @pub_identity_range value while assigning the range to that sub. If it is "Client" type subscription in that case we consider @identity_range value.
    You could run following query to check the range assigned to each publisher and subscriber:
    SELECT B.SUBSCRIBER_SERVER,B.DB_NAME,A.* FROM MSMERGE_IDENTITY_RANGE A,SYSMERGESUBSCRIPTIONS B
    WHERE A.SUBID=B.SUBID
    This should answer your other question as well.
    Vikas Rana | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker -------------------------------------------------------------------------------- This posting is provided "AS IS"
    with no warranties, and confers no rights. ------------------------------------------------

Maybe you are looking for

  • Boy what a screw job when the program freezes in the middle of site wide fo

    Boy what a screw job when the program freezes in the middle of site wide folder name changes. Then you never know what did get changed or not until you wade thru every possible one. And you cant just redo change the folder name, cuz the folder name d

  • Toded information in SAP

    Dear All, Ques1.  i want information regading particuler tcode ( example me54n ) used by which which user so how caqn i get infoamtion in SAP.. Problem 1. In my company 5 user atuhrised for particuler tocode so how can i get which date or / which tim

  • Failing nodes over results in a 2 minute gap where "nothing" is done

    We're on 3.7.1.9 and I'm testing a reconfiguration of our storage nodes on new hardware with adjusted heap sizing etc. Our primary use of coherence is as a distributed cache with clients having near caches. We don't use it as a data grid and therefor

  • SAP S/4 HANA for Oil and Gas

    Hi All, When SAP is announcing its road map for SAP S/4 HANA for Oil and Gas strategy. Which functionalities they are keeping from R/3, which they are dropping and which they are adding. How they are planning to simplify this area!! Cheers

  • Unable to create a disk image for mass deployment or to restore on other

    I am attempting to create a master 10.5 Leopard image that can be deployed to other Macs, but the restore process fails with the following error: *Restore Failure. Could not find any scan information. The source image needs to be imagedscanned/scanne