CMR - Can a primary key also be a foreign key?

Hi,
Has anyone come across the following problem? Although I mention Jdeveloper below I believe it is a general J2EE issue!
I have two tables
customer
customer_id (PK)
individual
customer_id (PK)
customer_id in individual is the primary key for that table. It is also a foreign key ( related back to customer).
If I use JDeveloper to drag in the two tables ( into a class diagraqm), I have a problem.
JDeveloper "sees" the Individual bean foreign key mapping and generates a getCustomer() method (which returns a handle to the appropriate customer bean).
However as it "removes" the getCustomer_id() method(which returns the actual customer_id), the primary_key reference is dropped.
When I try and compile, JDeveloper quite rightly complains with "where is the primary key".
Can anyone help? Do I need to make it a rule that the foreign key is not also the primary key?
thanks in advance,
Kevin

Hi Kevin,
I would not pursue this model if I was you. The only thing OC4J supports without killing yourself is to let each table has its own primary key (preferably not composed) and to make all foreign key's optional !
We have spent months trying to make it work and we are getting little or no support from oracle, even though we are paying many euros for a partnering contract.
greetz,
Jurgen

Similar Messages

  • Foreign Key Problem.. plz help urgently

    I have a Z table having these fields....
    MANDT     MANDT
    GSBER     GSBER (primary key also)
    HBKID     HBKID
    Foreign key is defined for GSBER (taken from TGSB table)
    Check table is defined both for GSBER and HBKID..
    i have created a table maintainence generator also..
    my Requirement is that... When i am entering value in   the table...
    for One value of GSBER there can be only one value of HBKID
    basically a  1 is to  1  relationship...
    i wil give an example..
    GSBER    HBKID
    120           555     ( Right)
    120           545     (not Allowed)
    343           555     (not allowed)
    ps: I have tried making the HBKID also as primary key... but then it is accepting values which are null. so i dont think thts  right...
    How can i use cardinality in this case.... If that is the solution?
    thanks
    Ankit

    Hi Ankit,
    1> Make the field GSBER as mandatory in overview and single screen in table   maintainance->double click the screen numbers->element list->special attr.->make input as required so that <b>null value</b> won't be accepted.
    2> Create a event in table maintainance ( <b>creating a new entries</b> )
    3> write an select query to check whether this value already exist in table in the fields GSBER, HBKID.
                 SELECT GSBER HBKID INTO WS_ZTABLE
                 FROM ZTABLE
                 WHERE GSBER EQ ZTABLE-GSBER OR
                       HBKID EQ ZTABLE-HBKID.
    4> IF any values found then display 'error message'
               else accept the entries.
    I think this will solve ur problem
    Regards,
    Nithya

  • Caching problem w/ primary-foreign key mapping

    I have seen this a couple of times now. It is not consistent enough to
    create a simple reproducible test case, so I will have to describe it to you
    with an example and hope you can track it down. It only occurs when caching
    is enabled.
    Here are the classes:
    class C1 { int id; C2 c2; }
    class C2 { int id; C1 c1; }
    Each class uses application identity using static nested Id classes: C1.Id
    and C2.Id. What is unusual is that the same value is used for both
    instances:
    int id = nextId();
    C1 c1 = new C1(id);
    C2 c2 = new C2(id);
    c1.c2 = c2;
    c2.c1 = c1;
    This all works fine using optimistic transactions with caching disabled.
    Although the integer values are the same, the oids are unique because each
    class defines its own unique oid class.
    Here is the schema and mapping (this works with caching disabled but fails
    with caching enabled):
    table t1: column id integer, column revision integer, primary key (id)
    table t2: column id integer, column revision integer, primary key (id)
    <jdo>
    <package name="test">
    <class name="C1" objectid-class="C1$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t1"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c2">
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    <class name="C2" objectid-class="C2$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t2"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c1">
    <extension vendor-name="kodo" key="dependent" value="true"/>
    <extension vendor-name="kodo" key="inverse-owner" value="c2"/>
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="table" value="t1"/>
    <extension vendor-name="kodo" key="ref-column.id" value="id"/>
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Because the ids are known to be the same, the primary key values are also
    used as foreign key values. Accessing C2.c1 is always non-null when caching
    is disabled. With caching is enabled C2.c1 is usually non-null but sometimes
    null. When it is null we get warnings about dangling references to deleted
    instances with id values of 0 and other similar warnings.
    The workaround is to add a redundant column with the same value. For some
    reason this works around the caching problem (this is unnecessary with
    caching disabled):
    table t1: column id integer, column id2 integer, column revision integer,
    primary key (id), unique index (id2)
    table t2: column id integer, column revision integer, primary key (id)
    <jdo>
    <package name="test">
    <class name="C1" objectid-class="C1$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t1"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c2">
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="column.id" value="id2"/>
    </extension>
    </field>
    </class>
    <class name="C2" objectid-class="C2$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t2"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c1">
    <extension vendor-name="kodo" key="dependent" value="true"/>
    <extension vendor-name="kodo" key="inverse-owner" value="c2"/>
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="table" value="t1"/>
    <extension vendor-name="kodo" key="ref-column.id" value="id2"/>
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Needless to say, the extra column adds a lot of overhead, including the
    addition of a second unique index, for no value other than working around
    the caching defect.

    Tom-
    The first thing that I think of whenever I see a problem like this is
    that the equals() and hashCode() methods of your application identity
    classes are not correct. Can you check them to ensure that they are
    written in accordance to the guidelines at:
    http://docs.solarmetric.com/manual.html#jdo_overview_pc_identity_application
    If that doesn't help address the problem, can you post the code for your
    application identity classes so we can double-check, and we will try to
    determine what might be causing the problem.
    In article <[email protected]>, Tom Landon wrote:
    I have seen this a couple of times now. It is not consistent enough to
    create a simple reproducible test case, so I will have to describe it to you
    with an example and hope you can track it down. It only occurs when caching
    is enabled.
    Here are the classes:
    class C1 { int id; C2 c2; }
    class C2 { int id; C1 c1; }
    Each class uses application identity using static nested Id classes: C1.Id
    and C2.Id. What is unusual is that the same value is used for both
    instances:
    int id = nextId();
    C1 c1 = new C1(id);
    C2 c2 = new C2(id);
    c1.c2 = c2;
    c2.c1 = c1;
    This all works fine using optimistic transactions with caching disabled.
    Although the integer values are the same, the oids are unique because each
    class defines its own unique oid class.
    Here is the schema and mapping (this works with caching disabled but fails
    with caching enabled):
    table t1: column id integer, column revision integer, primary key (id)
    table t2: column id integer, column revision integer, primary key (id)
    <jdo>
    <package name="test">
    <class name="C1" objectid-class="C1$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t1"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c2">
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    <class name="C2" objectid-class="C2$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t2"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c1">
    <extension vendor-name="kodo" key="dependent" value="true"/>
    <extension vendor-name="kodo" key="inverse-owner" value="c2"/>
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="table" value="t1"/>
    <extension vendor-name="kodo" key="ref-column.id" value="id"/>
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Because the ids are known to be the same, the primary key values are also
    used as foreign key values. Accessing C2.c1 is always non-null when caching
    is disabled. With caching is enabled C2.c1 is usually non-null but sometimes
    null. When it is null we get warnings about dangling references to deleted
    instances with id values of 0 and other similar warnings.
    The workaround is to add a redundant column with the same value. For some
    reason this works around the caching problem (this is unnecessary with
    caching disabled):
    table t1: column id integer, column id2 integer, column revision integer,
    primary key (id), unique index (id2)
    table t2: column id integer, column revision integer, primary key (id)
    <jdo>
    <package name="test">
    <class name="C1" objectid-class="C1$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t1"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c2">
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="column.id" value="id2"/>
    </extension>
    </field>
    </class>
    <class name="C2" objectid-class="C2$Id">
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="t2"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column" value="revision"/>
    </extension>
    <field name="id" primary-key="true">
    <extension vendor-name="kodo" key="jdbc-field-map" value="value">
    <extension vendor-name="kodo" key="column" value="id"/>
    </extension>
    </field>
    <field name="c1">
    <extension vendor-name="kodo" key="dependent" value="true"/>
    <extension vendor-name="kodo" key="inverse-owner" value="c2"/>
    <extension vendor-name="kodo" key="jdbc-field-map" value="one-one">
    <extension vendor-name="kodo" key="table" value="t1"/>
    <extension vendor-name="kodo" key="ref-column.id" value="id2"/>
    <extension vendor-name="kodo" key="column.id" value="id"/>
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Needless to say, the extra column adds a lot of overhead, including the
    addition of a second unique index, for no value other than working around
    the caching defect.
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Foreign Keys in Primary Key Class

    I am a newbie on toplink. I am getting an error when i run ejbc against the jar file with EJB2.0. One of the primary key classes two primary keys and both are foreign Keys to other tables. Primary Key class looks like this:
    public class LcaCyberzoneAssocPK implements java.io.Serializable
    public ValueHolderInterface lcaHolder;
    public ValueHolderInterface cyberzoneDefHolder;
    public LcaCyberzoneAssocPK(ValueHolderInterface lcaHolder,
    ValueHolderInterface cyberzoneDefHolder)
    super();
    this.lcaHolder = lcaHolder;
    this.cyberzoneDefHolder = cyberzoneDefHolder;
    Bean Class has following four methods:
    public abstract Lca getLcaHolder()
    throws RemoteException;
    public abstract CyberzoneDef getCyberzoneDefHolder()
    throws RemoteException;
    public abstract void setLcaHolder(Lca arg1)
    throws RemoteException;
    public abstract void setCyberzoneDefHolder(CyberzoneDef arg1)
    throws RemoteException;
    The error it is throwing is:
    ERROR: Error from ejbc: In EJB LcaCyberzoneAssoc, lcaHolder is declared as oracle.toplink.indirection.ValueHolderInterface in the
    pk class, but the corresponding getLcaHolder() method in the bean class returns com.qwest.danconfig.server.ejb.entity.Lca. These t
    ypes must match.
    Can you please help how to fix this or what is the correct way of doing it.
    Second question is, is there any document which explains migrating toplink from EJB1.1 to EJB2.0?
    Thanks

    The EJB 2.0 spec does not really allow relationships in the primary key class. You may be able to get it to work by using the EJB classes, not ValueHolderInterface in primary key class.
    Otherwise you will need to double map the foreign key fields as direct fields to be compliant with the spec. You can still have the one-to-one mappings but your model will need to keep both in synch and mark the one-to-one mappings as read-only.

  • Mapping error at deployment with foreign key data rule

    I have created data rules for enabling foreign key constraints. There are 4 foreign key constraints on the fact table.
    For the 1st foreign key ... its a single key match key1 on table 1
    For the others, its a composite key .. key1 and key2 on table 2
    key1 and key3 on table 3
    key1 and key4 on table 4
    When I implement with the single key foreign key constraint the mapping works fine. But when I apply the other foreign key data rules for composite keys, I get the following message while deploying ....
    M_CNT Create Warning ORA-06550: line 209, column 3:
    PL/SQL: ORA-00909: invalid number of arguments
    M_CNT Create Warning ORA-06550: line 520, column 65530:
    PL/SQL: SQL Statement ignored
    M_CNT Create Warning ORA-06550: line 56, column 65530:
    PL/SQL: SQL Statement ignored
    M_CNT Create Warning ORA-06550: line 673, column 3:
    PL/SQL: ORA-00909: invalid number of arguments
    The data rule setup done is type Referential
    Specify the number of attributes in row relationship - 2
    Specify the referencing cardinality of row relationship
    Minimum Count 1 Maximum Count n
    Specify the referenced cardinality of row relationship
    Minimum Count 1 Maximum Count n
    What is it that I am doing wrong ?
    Any suggestions. Help !!!!
    Regards,
    AW

    Hi AW,
    How can I overcome this situation ?The best solution as suggested by Jörg is use of surrogate keys.
    For every production key (composite or single) generate a corresponding surrogate key using sequence operator in staging area.
    This will not just solve your problem but it will be faster also (the joins will be faster with system-generated sequence numbers),
    In a data warehouse use of production keys as primary key for linking with (foreign key) is not recommended, keep the production keys as additional attributes.
    Regards,

  • Foreign Key Constraint Failure on Self-Referencing Table

    In a recent data deletion project, I ran into a problem where Oracle allowed for a record (the parent) to be deleted when there still existed a child record in the same table which referred to the parent.
    An abbreviated version of the table is as follows:
    create table test (
    template_id number not null,
    customer_id number null,
    parent_id number null,
    constraint pk_test primary key (template_id),
    constraint r_parent foreign key (parent_id) references test (template_id));
    The parent and child records are as follows:
    Parent: template_id = 100, customer_id = 200, parent_id = null
    Child: template_id = 101, customer_id = null, parent_id = 100
    Records were deleted from this table using:
    DELETE FROM test WHERE customer_id = 200;
    When this statement is executed, is it being executed as part of 155 delete statements using PL/SQL, and tens of thousands of records from 155 tables are being deleted. These delete statements have been ordered taking into account foreign key constraints. All 155 statements are being deleted in a single transaction. The delete statement above was the 23rd statement of the set to be executed. I would have expected when this delete statement was executed, an error would have been thrown. However, all 155 delete statements successfully complete, and after committing the results, the child record above still exists in the DB as an orphan. I also tried executing the first 23 statements manually in SQL*Plus (still one transaction), and the problem still occurs: the parent is deleted and the child is orphaned.
    If I execute the very simple example above, I do indeed get an referential constraint error.
    Has anyone ever encountered this situation? And does anyone have any ideas how to go about troubleshooting this problem. We need to know the cause of this, as we have a small handful of table with a similar self-referential foreign key constraint set-up.
    Thank you very much in advance,
    Mark

    First of all, the very simple example that I outlined above I have already tried and it worked: when I attempted to delete the parent a referential integrity error was thrown as one would expect. This small example was my test case to see if I could reproduce what I'm seeing in our application in a more manageable and demonstrable example. But as it worked, I'm still perplexed in reconciling the differences between what I'm seeing in our application (which I can't demonstrate in this help group) and the test case. When I used the test case in my first posting in this thread, I used it to help describe the problem I'm encountered, even though that small example works.
    Below is more of the table you've asked for.
    OWNER           CONSTRAINT_NAME          CONSTRAINT_TYPE     TABLE_NAME     SEARCH_CONDITION     R_OWNER            R_CONSTRAINT_NAME     DELETE_RULE     STATUS          DEFERRABLE            DEFERRED         VALIDATED     GENERATED     BAD     RELY     LAST_CHANGE           INDEX_OWNER  INDEX_NAME       INVALID     VIEW_RELATED
    "DOCPADMIN"     "R_TEMPLATE_PARENT"     "R"             "DCR_TEMPLATE"      (null)                  "DOCPADMIN"     "XPKDCR_TEMPLATE"     "NO ACTION"  "ENABLED"   "NOT DEFERRABLE"    "IMMEDIATE"  "VALIDATED"      "USER NAME"     (null)     (null)     "2010-01-13 19:01:21"     (null)        (null)         (null)       (null)
    "DOCPADMIN"     "XPKDCR_TEMPLATE"       "P"             "DCR_TEMPLATE"      (null)                       (null)     (null)                      (null)          "ENABLED"     "NOT DEFERRABLE"    "IMMEDIATE"      "VALIDATED"     "USER NAME"     (null)     (null)     "2010-01-13 15:48:31"     (null)     "XPKDCR_TEMPLATE"   (null)     (null)Overall, I haven't said that Oracle's FK mechanism is broken. What I've said is that I've got a situation that I'm trying to understand. My first attempt at my test case didn't work because the test case worked as it should. I'm trying to figure out another course of action to try and figure this situation out.

  • HOWTO: get JDev to show the foreign keys in Conn Nav & struct window

    Hi,
    I have SQL tables with foreign keys but the JDev connections navigator and table editor dont show them. They just look like primary keys in the "PK" column. The structure window shows a bunch of constraints with names like "SYS_C00143114" which is not very meaningful to me. Surely JDeveloper knows what these magic numbers mean and can trace the foreign keys for me.
    How can I get JDeveloper to show the foreign keys, and which table is referenced by that foreign key? Can I make it navigate from a table's foreign key value to the the correct tuple in the referenced table?
    Maybe this is an ER if JDev doesn't do this already. Navigating a schema, or drawing it showing all the foreign key references would be very handy. Navigating through actual table data would be nice too.
    Cheers,
    Simon.

    I found "new->Database Diagram" that does a lot of what I wanted, at least in mapping out the foreign key references. Now if I can just figure out how to print a .png file...
    It would still be nice for the connection navigator to trace them also.

  • Before delete trigger and foreign key relationship

    Hi,
    I am analysing one database for migration. On one parent table there is before delete trigger , to delete records from child. Also there is foreign key relationship on child table for this parent table.
    When I am deleting a row from parent, message gets displayed as "there are child records found."
    I would like to know, if there is foreign key relatioship then delete trigger on parent does't work, what is exactly happening?

    Could you post that trigger code and the Oracle version as well?
    With basic assumptions, I can't reproduce what you have stated here.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create table parent (id number primary key);
    Table created.
    SQL> create table child (id number);
    Table created.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent;
    Table altered.
    SQL> create or replace trigger bdr_parent
      2  before delete on parent
      3  for each row
      4  begin
      5  delete from child where id = :old.id;
      6  end;
      7  /
    Trigger created.
    SQL> insert into parent (id) values (1);
    1 row created.
    SQL> insert into child (id) values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> delete from parent where id = 1;
    1 row deleted.
    SQL> select * from parent;
    no rows selected
    SQL> select * from child;
    no rows selected
    SQL> rollback;
    Rollback complete.
    SQL> alter table child drop constraint fk_parent;
    Table altered.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent on delete cascade;
    Table altered.
    SQL> delete from parent where id = 1;
    delete from parent where id = 1
    ERROR at line 1:
    ORA-04091: table SCOTT.CHILD is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.BDR_PARENT", line 2
    ORA-04088: error during execution of trigger 'SCOTT.BDR_PARENT'
    SQL>

  • Composite Foreign Key Relationships

    I'm having problems defining relationships that are using the same set of fields in a composite primary key and a composite foreign key. Are there any examples for doing this kind of thing. I think I have the primary keys set up correctly but the foreign key defs aren't working yet. From the spec it looks ike it should be something like this:
    @ManyToOne
         @PrimaryKeyJoinColumns({
         @PrimaryKeyJoinColumn(name="CGMTI_ID"),
         @PrimaryKeyJoinColumn(name="MISSION_REF_DATE")})
         CgmtiHeader cgmtiHeader;
    Also, the composite foreign keys seem to make Dali's entity generation blow up.

    This mapping is missing the referencedcolumn definition, and because it is a composite pk, it cannot figure out a default value. So it should similar to:
    @ManyToOne
    @PrimaryKeyJoinColumns({
    @PrimaryKeyJoinColumn(name="CGMTI_ID", referencedColumnName="CGMTI_ID),
    @PrimaryKeyJoinColumn(name="MISSION_REF_DATE", referencedColumnName="MISSION_REF_DATE)})
    CgmtiHeader cgmtiHeader;
    Similar discussions exist in threads:
    Extra Columns in ManyToMany table workaround
    and
    http://forums.java.net/jive/thread.jspa?threadID=2564&messageID=36441
    both of which list blogs showing examples.
    Best Regards,
    Chris

  • Two foreign keys in one single table

    i have a table 'customers' with a 'customerid' as its primary key and another  table 'drinks' with a primary key 'drinkid'.now i have to create a table 'customerdrink' with its primary key as 'customerdrinkid' , and 'customerid' & 'drinkid' as
    its two foreign keys.how can i write the script in sql server to connect the first two tables with the last one ie how can i relate one primary key(customerdrinkid) with two foreign keys(customerid and drinkid) in a single query?pls help me out!!!

    >> I have a table 'customers' ...<< 
    How nice for you, but where is the DDL? Oh, I see you are the Great and Wonderful “shubha2323” who does not have to follow Netiquette or treat anyone with minimal respect when he demands they do his work him! 
    Where is what you already tried? Oh, the Great and Wonderful “shubha2323” does not try anything! His forum slaves should serve him! 
    Do you understand how rude you are when you ignore the basic forum rules? 
    CREATE TABLE Customers
    (customer_id CHAR(16) NOT NULL PRIMARY KEY,
    CREATE TABLE Drinks
    (drink_id CHAR(10) NOT NULL PRIMARY KEY,
    >> with a customer_id as its primary key and another table Drinks with a primary key drink_id. now I have to create a table 'customer_drink' with its primary key as 'customer_drink_id' <<
    You do not know what single quotes mean in ANSI/ISO Standard SQL, or how to follow ISO-11179 Standards for data element names. And this is a stupid idea. You have a key!! Do you know what a key is? 
    CREATE TABLE Drink_Preferences
    (customer_id CHAR(16) NOT NULL 
      REFERENCES Customers(customer_id)
      ON DELETE CASCADE,
     drink_id CHAR(10) NOT NULL 
      REFERENCES Drinks(drink_id)
      ON DELETE CASCADE,
     PRIMARY KEY (customer_id, drink_id),
     etc
    Stop posting until you have manners and you have read a book on RDBMS. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Foreign keys to same table / Who columns in User table???

    Hi All,
    We are designing a database for our client and we are using common columns in all tables like CreatedBy and UpdatedBy which are foreign keys to USER table. My question is can we use these two columns in USER table and have the foreign key constraints to the same tables?
    USER table script will look like following..
    CREATE TABLE XX_USER
         User_ID                              VARCHAR2(10)
    ,     CreatedBy                         NUMBER(10)
    ,     UpdatedBy                         NUMBER(10)
    ,     User_Name                         VARCHAR2(100)     NOT NULL
    ,     Designation                         VARCHAR2(100)     NOT NULL
    ,     CONSTRAINT USER_ISACTIVE_CHECK CHECK (Is_Active in ('Y', 'N'))
    ,     CONSTRAINT USER_KEY PRIMARY KEY (User_ID),
    ,     CONSTRAINT USER_CREATED_BY FOREIGN KEY (CREATED_BY)
         REFERENCES XX_USER (USER_ID)
    ,     CONSTRAINT USER_UPDATED_BY FOREIGN KEY (UPDATED_BY)
         REFERENCES XX_USER (USER_ID)
    );I think what I am doing (the above script) is not correct. Could someone please suggest me how can solve this issue?
    Thanks in advance,
    Oraebs

    user8644385 wrote:
    We are designing a database for our client and we are using common columns in all tables like CreatedBy and UpdatedBy which are foreign keys to USER table. My question is can we use these two columns in USER table and have the foreign key constraints to the same tables?You can. After fixing synatx errors:
    SQL> CREATE TABLE XX_USER
      2  (
      3   User_ID        VARCHAR2(10)
      4  , CreatedBy     NUMBER(10)
      5  , UpdatedBy     NUMBER(10)
      6  , User_Name     VARCHAR2(100) NOT NULL
      7  , Designation   VARCHAR2(100) NOT NULL
      8  , Is_Active     VARCHAR2(1)
      9  , CONSTRAINT USER_ISACTIVE_CHECK CHECK (Is_Active in ('Y', 'N'))
    10  , CONSTRAINT USER_KEY PRIMARY KEY (User_ID)
    11  , CONSTRAINT USER_CREATED_BY FOREIGN KEY (CreatedBy)
    12       REFERENCES XX_USER(USER_ID)
    13  , CONSTRAINT USER_UPDATED_BY FOREIGN KEY (UpdatedBy)
    14       REFERENCES XX_USER(USER_ID)
    15  )
    16  /
    Table created.
    SQL> Now USER_ID is a string while CreatedBy/UpdatedBy is a number. Even though it is allowed, it limits USER_ID to numeric strings and causes implicit conversions while validating. So I would change CreatedBy/UpdatedBy data type to VARCHAR2(10).
    SY.

  • How to avoid shared locks when validating foreign keys?

    I have a table with a FK and I want to update a row in that table without being blocked by another transaction which is updating the parent row at the same time. Here is an example:
    CREATE TABLE dbo.ParentTable
    PARENT_ID int NOT NULL,
    VALUE varchar(128) NULL,
    CONSTRAINT PK_ParentTable PRIMARY KEY (PARENT_ID)
    GO
    CREATE TABLE dbo.ChildTable
    CHILD_ID int NOT NULL,
    PARENT_ID INT NULL,
    VALUE varchar(128) NULL,
    CONSTRAINT PK_ChildTable PRIMARY KEY (CHILD_ID),
    CONSTRAINT FK_ChildTable__ParentTable FOREIGN KEY (PARENT_ID)
    REFERENCES dbo.ParentTable (PARENT_ID)
    GO
    INSERT INTO ParentTable(PARENT_ID, VALUE)
    VALUES (1, 'Some value');
    INSERT INTO ChildTable(CHILD_ID, PARENT_ID, VALUE)
    VALUES (1, 1, 'Some value');
    GO
    Now I have 2 transactions running at the same time:
    The first transaction:
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;BEGIN TRAN
    UPDATE ParentTable
    SET VALUE = 'Test'
    WHERE PARENT_ID = 1;
    The second transaction:
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;BEGIN TRAN
    UPDATE ChildTable
    SET VALUE = 'Test',
    PARENT_ID = 1
    WHERE CHILD_ID = 1;
    If 'UPDATE ParentTable' statement runs a bit earlier, then 'UPDATE ChildTable' statement is blocked untill the first transaction is committed or rollbacked. It happens because SQL Server acquires shared locks when validating foreign keys, even
    if the transaction is using read uncommitted, read committed snapshot (read committed using row versioning) or snapshot isolation level. I cannot see why change in the ParentTable.VALUE should prevent me from updating ChildTable. Please note that ParentTable.PARENT_ID
    is not changed by the first transaction, which means that from FK's point of view whatevere is set to the ParentTable.VALUE is never a problem for referential integrity. So, such blocking behavior seems to me not logical. Furthermore, it contradicts to the
    MSDN:
    Transactions running at the READ UNCOMMITTED level do not issue shared locks to prevent other transactions from modifying data read by the current transaction. READ UNCOMMITTED transactions are also not blocked by exclusive locks that would prevent the
    current transaction from reading rows that have been modified but not committed by other transactions. 
    Does anybody know how to workaround the issue? In other words, are there any tricks to avoid shared locks when validating foreign keys? (Disabling FK is not an option.) Thank you.
    Alexey

    If you change the primary key of the parent table to be nonclustered, there is no blocking.
    Indeed, when I update ParentTable.VALUE, then:
    in case of PK_ParentTable is clustered, a particular row in the clustered index is locked (request_mode:X, resource_type: KEY)
    in case of PK_ParentTable is non-clustered, a particular physical row in the heap is locked (request_mode:X, resource_type: RID).
    and when I update ChildTable.PARENT_ID, then:
    in case of PK_ParentTable is clustered, this index is used to verify referential integrity:
    in case of PK_ParentTable is non-clustered, again this index is used to verify referential integrity, but this time it is not locked:
    It is important to note that in both cases SQL Server acquires shared locks when validating foreign keys. The principal difference is that in case of clustered PK_ParentTable the request is blocked, while for non-clustered index it is granted.
    Thank you, Erland for the idea and explanations.
    The only thing that upsets me is that this solution cannot be applied, because I don't want to convert PK_ParentTable from clustered to non-clustered just to avoid blocking issues. It is a pity that SQL Server is not smart enough to realize that:
    ParentTable.PARENT_ID is not changed and, as a result, should not be locked
    ChildTable.PARENT_ID is not actually changed either (old value in my example is 1 and the new value is also 1) and, as a result, there is no need at all for validating the foreign key.
    In fact, the problem I described is just a tip of the iceberg. The real challenge is that I have deadlocks because of the FK validation. In reality, the first transaction has an additional statement which updates ChildTable:
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
    BEGIN TRAN
    UPDATE ParentTable
    SET VALUE = 'Test'
    WHERE PARENT_ID = 1;
    UPDATE ChildTable
    SET VALUE = 'Test'
    WHERE PARENT_ID = 1;
    The result is famous message:
    Msg 1205, Level 13, State 51, Line xx
    Transaction (Process ID xx) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    I know that if I change the order of the two statements, it will solve the deadlock issue. But let's imagine I cannot do it. What are the other options?
    Alexey

  • Find foreign key which are able or not

    Same as the topic ~ how can I find all the able/unable foreign key/contraints inside a database ? Using TSQL

    Hello,
    Please try the scripts provided on the following resources:
    http://blog.sqlauthority.com/2009/07/17/sql-server-two-methods-to-retrieve-list-of-primary-keys-and-foreign-keys-of-database/
    http://blog.sqlauthority.com/2006/11/01/sql-server-query-to-display-foreign-key-relationships-and-name-of-the-constraint-for-each-table-in-database/
    http://blog.sqlauthority.com/2007/09/16/sql-server-2005-list-all-the-constraint-of-database-find-primary-key-and-foreign-key-constraint-in-database/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Wrong order foreign key constraints

    Hi,
    i have problems with non-deferred foreing key constraints:
    I have a table "PERSON" and a table "ADRESSE" which has a foreign key
    to "PERSON". Both tables have primary keys with two columns.
    In the mappings I use application identity. The mappings are generated by
    xdoclet.
    We cannot use deferred constraint because we have to support following
    databases: Oracle, Firebird, MS SQL, DB2.
    I tested the mappings with Oracle and Firebird and got this exception
    (with SQL Trace):
    5602 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (1 errors)>
    [15 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 1, (String) [email protected], (String)
    04941 183742, (int) 12761, (int) 1, (int) 1, (String) 0171 2846751,
    (String) Oldenburg, (int) 12760, (String) 26129, (int) 1, (null) null,
    (String) Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=0]
    5602 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 3, (null) null, (null) null, (int) 12764,
    (int) 1, (int) 0, (null) null, (String) Sylt, (int) 12759, (String) 25980,
    (int) 0, (null) null, (String) Stephanstra__e 47, (String) 04651 19283]
    [reused=1]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 13390902 INSERT INTO VAMP.PERSON (ANREDEID, ID,
    KUNDENNR, LOESCHBEMERKUNG, MANDANTID, NAME1, NAME2, PERSONENDATUM,
    PERSONENORT, TYP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(null)
    null, (int) 12759, (String) 9999452800, (null) null, (int) 1, (String)
    Horstmann, (String) Manfred, (Timestamp) 1959-03-10 00:00:00.381, (String)
    Flensburg, (int) 1] [reused=0]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 1, (String) [email protected], (String)
    04941 183742, (int) 12763, (int) 1, (int) 1, (String) 0171 2846751,
    (String) Oldenburg, (int) 12759, (String) 26129, (int) 1, (null) null,
    (String) Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=2]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 3, (null) null, (null) null, (int) 12762,
    (int) 1, (int) 0, (null) null, (String) Sylt, (int) 12760, (String) 25980,
    (int) 0, (null) null, (String) Stephanstra__e 47, (String) 04651 19283]
    [reused=3]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 13390902 INSERT INTO VAMP.PERSON (ANREDEID, ID,
    KUNDENNR, LOESCHBEMERKUNG, MANDANTID, NAME1, NAME2, PERSONENDATUM,
    PERSONENORT, TYP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(null)
    null, (int) 12760, (String) 9999452801, (null) null, (int) 1, (String)
    Horstmann, (String) Christine, (Timestamp) 1972-03-10 00:00:00.381,
    (String) Erfurt, (int) 1] [reused=1]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 11320634 INSERT INTO VAMP.NATPERSON
    (ANZAHLKINDER, ARBEITGEBERID, BEITRAGSSATZ, BERUFID, BRANCHEID,
    FAMILIENSTAND, FAMSTANDSEIT, FINANZAMTID, GEBIETSFREMDERAWG, GUETERSTAND,
    IDBEHOERDE, IDNR, KIRCHENSTEUER, KVID, MANDANTID, PERSONID, PRIVATKV,
    STAAT, STEUERBERATERID, STEUERKLASSE, STEUERNR, STEUERTARIF, TITEL) VALUES
    [params=(int) 0, (null) null, (double) 0.0, (null) null, (int) 12410,
    (int) 2, (Timestamp) 1991-12-12 00:00:00.381, (null) null, (int) 0, (int)
    3, (null) null, (null) null, (int) 0, (int) 12576, (int) 1, (int) 12760,
    (int) 0, (null) null, (null) null, (int) 0, (null) null, (int) 1, (null)
    null] [reused=0]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 11320634 INSERT INTO VAMP.NATPERSON
    (ANZAHLKINDER, ARBEITGEBERID, BEITRAGSSATZ, BERUFID, BRANCHEID,
    FAMILIENSTAND, FAMSTANDSEIT, FINANZAMTID, GEBIETSFREMDERAWG, GUETERSTAND,
    IDBEHOERDE, IDNR, KIRCHENSTEUER, KVID, MANDANTID, PERSONID, PRIVATKV,
    STAAT, STEUERBERATERID, STEUERKLASSE, STEUERNR, STEUERTARIF, TITEL) VALUES
    [params=(int) 0, (null) null, (double) 0.0, (int) 12362, (int) 12378,
    (int) 2, (Timestamp) 1991-12-12 00:00:00.381, (null) null, (int) 0, (int)
    3, (null) null, (null) null, (int) 0, (int) 12576, (int) 1, (int) 12759,
    (int) 0, (null) null, (null) null, (int) 0, (null) null, (int) 1, (null)
    null] [reused=1]
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> [16 ms] rollback
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> return
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> [0 ms] close
    com.solarmetric.jdbc.ReportingSQLException: ORA-02291: integrity
    constraint (VAMP.ADRESSE_PS) violated - parent key not found
    {prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART, EMAIL, FAXNR,
    ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ, POSTADRESSE,
    POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?) [params=(int) 1, (String) [email protected], (String) 04941
    183742, (int) 12761, (int) 1, (int) 1, (String) 0171 2846751, (String)
    Oldenburg, (int) 12760, (String) 26129, (int) 1, (null) null, (String)
    Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=0]} [code=2291,
    state=23000]
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:124)
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator.access$600(LoggingConnectionDecorator.java:19)
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:728)
         at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:362)
    How can I force it to insert in the table "NATPERSON" first and then in
    the table "ADRESSE"?
    I use following JDBC-drivers:
    Firebird: 1.5.5
    Oracle: 9.2.0.1.0
    My property file:
    <!-- standard properties for all dbms -->
    <prop key="kodo.LicenseKey">LICENSE KEY REMOVED</prop>
    <prop key="kodo.ConnectionFactoryProperties">MaxCachedStatements=150,
    MaxActive=50, MaxIdle=50</prop>
    <prop key="kodo.FetchBatchSize">200</prop>
    <prop key="kodo.DataCache">true(CacheSize=5000)</prop>
    <prop key="kodo.RemoteCommitProvider">sjvm</prop>
    <prop key="kodo.jdbc.MappingFactory">metadata</prop>
    <prop key="kodo.jdbc.ForeignKeyConstraints">true</prop>
    <prop key="kodo.jdbc.SchemaFactory">native</prop>
    <prop
    key="javax.jdo.PersistenceManagerFactoryClass">kodo.jdbc.runtime.JDBCPersistenceManagerFactory</prop>
    <prop key="javax.jdo.option.Optimistic">true</prop>
    <!-- oracle connection properties -->
    <prop key="kodo.jdbc.DBDictionary">oracle</prop>
    <prop
    key="javax.jdo.option.ConnectionDriverName">oracle.jdbc.driver.OracleDriver</prop>
    <prop key="javax.jdo.option.ConnectionURL">..</prop>
    <prop key="javax.jdo.option.ConnectionUserName">..</prop>
    <prop key="javax.jdo.option.ConnectionPassword">..</prop>
    <prop key="kodo.jdbc.SequenceFactory">native</prop>
    <prop key="kodo.jdbc.Schemas">..</prop>
    <!-- firebird connection properties
    <prop key="kodo.jdbc.DBDictionary">kodo.jdbc.sql.FirebirdDictionary</prop>
    <prop
    key="javax.jdo.option.ConnectionDriverName">org.firebirdsql.jdbc.FBDriver</prop>
    <prop key="javax.jdo.option.ConnectionURL">..</prop>
    <prop key="javax.jdo.option.ConnectionUserName">..</prop>
    <prop key="javax.jdo.option.ConnectionPassword">..</prop>
    <prop key="kodo.jdbc.SequenceFactory">native(TableName=SYSDUAL,
    Format="SELECT GEN_ID({0},1) FROM {1}")</prop>
    -->
    My database schema looks like this:
    TABLE PERSON
    FIELD MANDANTID (SMALLINT REQUIRED COMMENT (""))
    FIELD ID (AUTOINC COMMENT (""))
    FIELD TYP (SMALLINT REQUIRED COMMENT (""))
    FIELD KUNDENNR (CHAR(15) COMMENT ("Kundennummer"))
    PRIMARY KEY
    FIELD MANDANTID
    FIELD ID
    FOREIGN KEY MD
    TABLE MANDANT
    FIELD MANDANTID
    INDEX KDNR
    FIELD MANDANTID
    FIELD KUNDENNR
    UNIQUE
    TABLE ADRESSE
    FIELD MANDANTID (SMALLINT REQUIRED COMMENT (""))
    FIELD ID (AUTOINC COMMENT (""))
    FIELD PERSONID (LONGINT REQUIRED COMMENT (""))
    PRIMARY KEY
    FIELD MANDANTID
    FIELD ID
    FOREIGN KEY PS
    TABLE PERSON
    FIELD MANDANTID
    FIELD PERSONID
    My metadata looks like this:
    <class name="PersonDO"
    identity-type="application"
    objectid-class="com.elaxy.vamp.dom.person.PersonDOId"
    persistence-capable-superclass="com.elaxy.vamp.dom.AbstractDO">
    <extension vendor-name="kodo"
    key="jdbc-class-ind"
    value="metadata-value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-ind/column"
    value="TYP">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-ind-value"
    value="-1">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="PERSON">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map/column"
    value="ID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map/column"
    value="MANDANTID">
    </extension>
    <field name="kundenNr"
    persistence-modifier="persistent">
    </field>
    <field name="adressen"
    persistence-modifier="persistent">
    <collection
    element-type="com.elaxy.vamp.dom.person.AdresseDO">
    </collection>
    <extension vendor-name="kodo"
    key="jdbc-field-map"
    value="one-many">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/ref-column.MANDANTID"
    value="MANDANTID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/ref-column.ID"
    value="PERSONID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/table"
    value="ADRESSE">
    </extension>
    </field>
    .. fields ..
    </class>
    <class name="AdresseDO"
    identity-type="application"
    objectid-class="com.elaxy.vamp.dom.person.AdresseDOId"
    persistence-capable-superclass="com.elaxy.vamp.dom.AbstractDO">
    <extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="ADRESSE">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-sequence-name"
    value="ADRESSE_SEQ">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map/column"
    value="ID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map/column"
    value="MANDANTID">
    </extension>
    .. fields ..
    </class>
    Many thanks,
    Jan

    Marc
    This is a part of the output from the "schemagen" tool:
    <schemas>
    <schema name="VAMP">
    <table name="ADRESSE">
    <pk name="ADRESSE_PRIMARY">
    <on column="ID"/>
    <on column="MANDANTID"/>
    </pk>
    <column name="ADRESSART" type="decimal" type-name="NUMBER"
    size="5"/>
    <column name="EMAIL" type="varchar" type-name="VARCHAR2"
    size="30"/>
    <column name="FAXNR" type="varchar" type-name="VARCHAR2"
    size="25"/>
    <column name="ID" type="decimal" type-name="NUMBER"
    not-null="true" size="10"/>
    <column name="LAND" type="decimal" type-name="NUMBER"
    size="10"/>
    <column name="MANDANTID" type="decimal" type-name="NUMBER"
    not-null="true" size="5"/>
    <column name="MELDEADRESSE" type="decimal" type-name="NUMBER"
    size="1"/>
    <column name="MOBILNR" type="varchar" type-name="VARCHAR2"
    size="25"/>
    <column name="ORT" type="varchar" type-name="VARCHAR2"
    size="30"/>
    <column name="PERSONID" type="decimal" type-name="NUMBER"
    not-null="true" size="10"/>
    <column name="PLZ" type="varchar" type-name="VARCHAR2"
    size="5"/>
    <column name="POSTADRESSE" type="decimal" type-name="NUMBER"
    size="1"/>
    <column name="POSTFACH" type="varchar" type-name="VARCHAR2"
    size="10"/>
    <column name="STRASSE" type="varchar" type-name="VARCHAR2"
    size="30"/>
    <column name="TELEFONNR" type="varchar" type-name="VARCHAR2"
    size="25"/>
    <fk name="ADRESSE_PS" delete-action="cascade"
    to-table="VAMP.PERSON">
    <join column="MANDANTID" to-column="MANDANTID"/>
    <join column="PERSONID" to-column="ID"/>
    </fk>
    <index name="ADRESSE_ORT">
    <on column="MANDANTID"/>
    <on column="ORT"/>
    </index>
    <index name="ADRESSE_PLZ">
    <on column="MANDANTID"/>
    <on column="PLZ"/>
    </index>
    <index name="ADRESSE_PS">
    <on column="MANDANTID"/>
    <on column="PERSONID"/>
    </index>
    <index name="ADRESSE_STR">
    <on column="MANDANTID"/>
    <on column="STRASSE"/>
    </index>
    </table>
    The foreign key "ADRESSE_PS" was identified correctly.
    I've taken a look at the class OracleDictionary and it seems that the
    object "ForeignKey" considers only one column from the foreign keys -
    but I use foreign keys that include two columns ("MANDANTID", "PERSONID").
    Is that right or are foreign keys with two columns allowed by the
    OracleDictionary?
    Marc Prud'hommeaux wrote:
    Jan-
    That is odd ... Kodo should be identifying the foreign keys and ordering
    the statements accordingly. The mappings appear correct to me at first
    glance. If you run the "schemagen" tool, does Kodo correctly identify
    the foreign key constraints in the database? Can you post the output
    from the command so we can take a look?
    Jan-Esdert Franken wrote:
    Hi,
    i have problems with non-deferred foreing key constraints:
    I have a table "PERSON" and a table "ADRESSE" which has a foreign key
    to "PERSON". Both tables have primary keys with two columns.
    In the mappings I use application identity. The mappings are generated by
    xdoclet.
    We cannot use deferred constraint because we have to support following
    databases: Oracle, Firebird, MS SQL, DB2.
    I tested the mappings with Oracle and Firebird and got this exception
    (with SQL Trace):
    5602 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (1 errors)>
    [15 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 1, (String) [email protected], (String)
    04941 183742, (int) 12761, (int) 1, (int) 1, (String) 0171 2846751,
    (String) Oldenburg, (int) 12760, (String) 26129, (int) 1, (null) null,
    (String) Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=0]
    5602 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 3, (null) null, (null) null, (int) 12764,
    (int) 1, (int) 0, (null) null, (String) Sylt, (int) 12759, (String) 25980,
    (int) 0, (null) null, (String) Stephanstra__e 47, (String) 04651 19283]
    [reused=1]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 13390902 INSERT INTO VAMP.PERSON (ANREDEID, ID,
    KUNDENNR, LOESCHBEMERKUNG, MANDANTID, NAME1, NAME2, PERSONENDATUM,
    PERSONENORT, TYP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(null)
    null, (int) 12759, (String) 9999452800, (null) null, (int) 1, (String)
    Horstmann, (String) Manfred, (Timestamp) 1959-03-10 00:00:00.381, (String)
    Flensburg, (int) 1] [reused=0]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (2 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 1, (String) [email protected], (String)
    04941 183742, (int) 12763, (int) 1, (int) 1, (String) 0171 2846751,
    (String) Oldenburg, (int) 12759, (String) 26129, (int) 1, (null) null,
    (String) Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=2]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART,
    EMAIL, FAXNR, ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ,
    POSTADRESSE, POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?, ?, ?) [params=(int) 3, (null) null, (null) null, (int) 12762,
    (int) 1, (int) 0, (null) null, (String) Sylt, (int) 12760, (String) 25980,
    (int) 0, (null) null, (String) Stephanstra__e 47, (String) 04651 19283]
    [reused=3]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 13390902 INSERT INTO VAMP.PERSON (ANREDEID, ID,
    KUNDENNR, LOESCHBEMERKUNG, MANDANTID, NAME1, NAME2, PERSONENDATUM,
    PERSONENORT, TYP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(null)
    null, (int) 12760, (String) 9999452801, (null) null, (int) 1, (String)
    Horstmann, (String) Christine, (Timestamp) 1972-03-10 00:00:00.381,
    (String) Erfurt, (int) 1] [reused=1]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 11320634 INSERT INTO VAMP.NATPERSON
    (ANZAHLKINDER, ARBEITGEBERID, BEITRAGSSATZ, BERUFID, BRANCHEID,
    FAMILIENSTAND, FAMSTANDSEIT, FINANZAMTID, GEBIETSFREMDERAWG, GUETERSTAND,
    IDBEHOERDE, IDNR, KIRCHENSTEUER, KVID, MANDANTID, PERSONID, PRIVATKV,
    STAAT, STEUERBERATERID, STEUERKLASSE, STEUERNR, STEUERTARIF, TITEL) VALUES
    [params=(int) 0, (null) null, (double) 0.0, (null) null, (int) 12410,
    (int) 2, (Timestamp) 1991-12-12 00:00:00.381, (null) null, (int) 0, (int)
    3, (null) null, (null) null, (int) 0, (int) 12576, (int) 1, (int) 12760,
    (int) 0, (null) null, (null) null, (int) 0, (null) null, (int) 1, (null)
    null] [reused=0]
    5618 TRACE [main] kodo.jdbc.SQL - <t 26577913, conn 33108879 (3 errors)>
    [0 ms] executing prepstmnt 11320634 INSERT INTO VAMP.NATPERSON
    (ANZAHLKINDER, ARBEITGEBERID, BEITRAGSSATZ, BERUFID, BRANCHEID,
    FAMILIENSTAND, FAMSTANDSEIT, FINANZAMTID, GEBIETSFREMDERAWG, GUETERSTAND,
    IDBEHOERDE, IDNR, KIRCHENSTEUER, KVID, MANDANTID, PERSONID, PRIVATKV,
    STAAT, STEUERBERATERID, STEUERKLASSE, STEUERNR, STEUERTARIF, TITEL) VALUES
    [params=(int) 0, (null) null, (double) 0.0, (int) 12362, (int) 12378,
    (int) 2, (Timestamp) 1991-12-12 00:00:00.381, (null) null, (int) 0, (int)
    3, (null) null, (null) null, (int) 0, (int) 12576, (int) 1, (int) 12759,
    (int) 0, (null) null, (null) null, (int) 0, (null) null, (int) 1, (null)
    null] [reused=1]
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> [16 ms] rollback
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> return
    5634 TRACE [main] kodo.jdbc.JDBC - <t 26577913, conn 33108879 (3
    errors)> [0 ms] close
    com.solarmetric.jdbc.ReportingSQLException: ORA-02291: integrity
    constraint (VAMP.ADRESSE_PS) violated - parent key not found
    {prepstmnt 22511833 INSERT INTO VAMP.ADRESSE (ADRESSART, EMAIL, FAXNR,
    ID, MANDANTID, MELDEADRESSE, MOBILNR, ORT, PERSONID, PLZ, POSTADRESSE,
    POSTFACH, STRASSE, TELEFONNR) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?) [params=(int) 1, (String) [email protected], (String) 04941
    183742, (int) 12761, (int) 1, (int) 1, (String) 0171 2846751, (String)
    Oldenburg, (int) 12760, (String) 26129, (int) 1, (null) null, (String)
    Ammerl__nder Heerstra__e 19, (String) 04941 183740] [reused=0]} [code=2291,
    state=23000]
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:124)
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator.access$600(LoggingConnectionDecorator.java:19)
         at
    com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:728)
         at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:362)
    How can I force it to insert in the table "NATPERSON" first and then in
    the table "ADRESSE"?
    I use following JDBC-drivers:
    Firebird: 1.5.5
    Oracle: 9.2.0.1.0
    My property file:
    <!-- standard properties for all dbms -->
    <prop key="kodo.LicenseKey">LICENSE KEY REMOVED</prop>
    <prop key="kodo.ConnectionFactoryProperties">MaxCachedStatements=150,
    MaxActive=50, MaxIdle=50</prop>
    <prop key="kodo.FetchBatchSize">200</prop>
    <prop key="kodo.DataCache">true(CacheSize=5000)</prop>
    <prop key="kodo.RemoteCommitProvider">sjvm</prop>
    <prop key="kodo.jdbc.MappingFactory">metadata</prop>
    <prop key="kodo.jdbc.ForeignKeyConstraints">true</prop>
    <prop key="kodo.jdbc.SchemaFactory">native</prop>
    <prop
    key="javax.jdo.PersistenceManagerFactoryClass">kodo.jdbc.runtime.JDBCPersistenceManagerFactory</prop>
    <prop key="javax.jdo.option.Optimistic">true</prop>
    <!-- oracle connection properties -->
    <prop key="kodo.jdbc.DBDictionary">oracle</prop>
    <prop
    key="javax.jdo.option.ConnectionDriverName">oracle.jdbc.driver.OracleDriver</prop>
    <prop key="javax.jdo.option.ConnectionURL">..</prop>
    <prop key="javax.jdo.option.ConnectionUserName">..</prop>
    <prop key="javax.jdo.option.ConnectionPassword">..</prop>
    <prop key="kodo.jdbc.SequenceFactory">native</prop>
    <prop key="kodo.jdbc.Schemas">..</prop>
    <!-- firebird connection properties
    <prop key="kodo.jdbc.DBDictionary">kodo.jdbc.sql.FirebirdDictionary</prop>
    <prop
    key="javax.jdo.option.ConnectionDriverName">org.firebirdsql.jdbc.FBDriver</prop>
    <prop key="javax.jdo.option.ConnectionURL">..</prop>
    <prop key="javax.jdo.option.ConnectionUserName">..</prop>
    <prop key="javax.jdo.option.ConnectionPassword">..</prop>
    <prop key="kodo.jdbc.SequenceFactory">native(TableName=SYSDUAL,
    Format="SELECT GEN_ID(,1) FROM ")</prop>
    -->
    My database schema looks like this:
    TABLE PERSON
    FIELD MANDANTID (SMALLINT REQUIRED COMMENT (""))
    FIELD ID (AUTOINC COMMENT (""))
    FIELD TYP (SMALLINT REQUIRED COMMENT (""))
    FIELD KUNDENNR (CHAR(15) COMMENT ("Kundennummer"))
    PRIMARY KEY
    FIELD MANDANTID
    FIELD ID
    FOREIGN KEY MD
    TABLE MANDANT
    FIELD MANDANTID
    INDEX KDNR
    FIELD MANDANTID
    FIELD KUNDENNR
    UNIQUE
    TABLE ADRESSE
    FIELD MANDANTID (SMALLINT REQUIRED COMMENT (""))
    FIELD ID (AUTOINC COMMENT (""))
    FIELD PERSONID (LONGINT REQUIRED COMMENT (""))
    PRIMARY KEY
    FIELD MANDANTID
    FIELD ID
    FOREIGN KEY PS
    TABLE PERSON
    FIELD MANDANTID
    FIELD PERSONID
    My metadata looks like this:
    <class name="PersonDO"
    identity-type="application"
    objectid-class="com.elaxy.vamp.dom.person.PersonDOId"
    persistence-capable-superclass="com.elaxy.vamp.dom.AbstractDO">
    <extension vendor-name="kodo"
    key="jdbc-class-ind"
    value="metadata-value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-ind/column"
    value="TYP">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-ind-value"
    value="-1">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="PERSON">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map/column"
    value="ID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map/column"
    value="MANDANTID">
    </extension>
    <field name="kundenNr"
    persistence-modifier="persistent">
    </field>
    <field name="adressen"
    persistence-modifier="persistent">
    <collection
    element-type="com.elaxy.vamp.dom.person.AdresseDO">
    </collection>
    <extension vendor-name="kodo"
    key="jdbc-field-map"
    value="one-many">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/ref-column.MANDANTID"
    value="MANDANTID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/ref-column.ID"
    value="PERSONID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-map/table"
    value="ADRESSE">
    </extension>
    </field>
    .. fields ..
    </class>
    <class name="AdresseDO"
    identity-type="application"
    objectid-class="com.elaxy.vamp.dom.person.AdresseDOId"
    persistence-capable-superclass="com.elaxy.vamp.dom.AbstractDO">
    <extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="ADRESSE">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-sequence-name"
    value="ADRESSE_SEQ">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.id/jdbc-field-map/column"
    value="ID">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId"
    value="">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map"
    value="value">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-field-mappings/AbstractDO.mandantId/jdbc-field-map/column"
    value="MANDANTID">
    </extension>
    .. fields ..
    </class>
    Many thanks,
    Jan
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Disabling Foreign keys before Insert

    DB version:10gR2
    Is it a standard practice to disable Foreign keys when you have Huge INSERTs . Is there performance enhancement by deferring the Foreign key Check during Huge INSERTs?
    Our client want to disable the FKs before a huge INSERT. They say they can manually rectify all issues related to Foreign key violation resulting from Disabling the FK.
    What do you guys reckon?

    It should hapen an enhancement performance by deferring the Foreign key Check during Huge INSERTs.
    The same thing with triggers.
    If you are sure that data that you want to insert is not inconsistent with the data on the DB, or that you manually rectify inconsistencies after the insert, then there is no problem by disabling Foreign key constraints/triggers.
    Also there are gains of performance if you drop of the indices (if there's any) and recreate after the Huge INSERT.
    Regards.

Maybe you are looking for

  • BAPI for scheduling entire project?

    Hi!, we need to simulate a scheduling depending on dates introduced by user. Does anybody know if its possible to schedule entire project via function or similar ECC 6.0?. CJ29 seems to be difficult becase log of changes are shown in ALV... Thanks fo

  • Message ID in Message Mapping

    Hello everyone, I have a BPM that executes an ABAP Proxy, my problem is that I need to send in the ABAP Proxy strcuture the Unique Message Id that the BPM has in XI, I don't know if I can obtain this field in Message Mapping and map it to the ABAP Pr

  • Manually mange music and videos problems with deletion from iPod

    When deleting music off my iPod using iTunes it does it but does not free up space instead it adds more space to the 'Other" area (Orange bar) The blue area (music section) does not free up. See this http://www.flickr.com/photos/20903619@N00/25232459

  • Hide Tools pane in Adobe Acrobat Reader DC?

    How can I permanently hide the options that appear on the right side of my screen when I use Adobe Acrobat Reader DC to open a document or image I've saved on my desktop screen?

  • I have a real huge gripe with iPod for iPad

    I have a big music library which spans many genres and many artists in each genre. What I loved about the iPod app on the iPhone is that when I picked a genre it would take me to a list of artists that are under that genre. Which is great because if