[ 
https://issues.apache.org/jira/browse/OFBIZ-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564306#action_12564306
 ] 

jack_guo edited comment on OFBIZ-1607 at 1/30/08 9:43 PM:
------------------------------------------------------------

the other configuration to let ofbiz work with the db2
1.change the database pagesize to 16k
2.add two fk-name to two entity's relation, one is PartyInvitationGroupAssoc 
the other is PartyInvitationRoleAssoc:
<entity entity-name="PartyInvitationGroupAssoc"
            package-name="org.ofbiz.party.party"
            title="Party Invitation Group Assoc Entity">
        <field name="partyInvitationId" type="id-ne"></field>
        <field name="partyIdTo" type="id-ne"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="partyIdTo"/>
        <relation type="one" title="To" rel-entity-name="PartyGroup">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" title="To" rel-entity-name="Party">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PTY_INT_GA_PTY_INT" 
rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
    <entity entity-name="PartyInvitationRoleAssoc"
            package-name="org.ofbiz.party.party"
            title="Party Invitation Role Assoc Entity">
        <field name="partyInvitationId" type="id-ne"></field>
        <field name="roleTypeId" type="id-ne"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="roleTypeId"/>
        <relation type="one" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="PTY_INT_RA_PTY_INT" 
rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
this avoid the same fk-name problems. I think it's the good habit we need add 
the fk-name if there is more than one relation with the same entity.
3.the INVITEM_SOFID and INVITEM_ACTNM index is unique in InventoryItem entity, 
but The demo data do not include the unique data. so, when insert the data It 
will thrown exeception, it happen in DemoProduct.xml, I add the data like this:

  <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" 
        inventoryItemId="9000" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="2.5" 
softIdentifier="9000" activationNumber="9000"/>
    <InventoryItemDetail inventoryItemId="9000" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="500" 
quantityOnHandDiff="500"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01" 
        inventoryItemId="9001" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="2.5"  
softIdentifier="9001" activationNumber="9001"/>
    <InventoryItemDetail inventoryItemId="9001" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" 
quantityOnHandDiff="5"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL02" 
        inventoryItemId="9002" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="3.0"  
softIdentifier="9002" activationNumber="9002"/>
    <InventoryItemDetail inventoryItemId="9002" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="15" 
quantityOnHandDiff="15"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL02" 
        inventoryItemId="9003" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="3.0"  
softIdentifier="9003" activationNumber="9003"/>
    <InventoryItemDetail inventoryItemId="9003" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="3" 
quantityOnHandDiff="3"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL03" 
        inventoryItemId="9004" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="4.5"  
softIdentifier="9004" activationNumber="9004"/>
    <InventoryItemDetail inventoryItemId="9004" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="50" 
quantityOnHandDiff="50"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL03" 
        inventoryItemId="9005" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="4.5"  
softIdentifier="9005" activationNumber="9005"/>
    <InventoryItemDetail inventoryItemId="9005" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" 
quantityOnHandDiff="5"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL04" 
        inventoryItemId="9006" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-5569" ownerPartyId="Company" currencyUomId="USD" unitCost="5.0"  
softIdentifier="9006" activationNumber="9006"/>
    <InventoryItemDetail inventoryItemId="9006" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>

    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9010" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9010" activationNumber="9010"/>
    <InventoryItemDetail inventoryItemId="9010" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9011" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9011" activationNumber="9011"/>
    <InventoryItemDetail inventoryItemId="9011" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9012" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9012" activationNumber="9012"/>
    <InventoryItemDetail inventoryItemId="9012" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9013" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9013" activationNumber="9013"/>
    <InventoryItemDetail inventoryItemId="9013" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>

    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9021" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-1" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9021" activationNumber="9021"/>
    <InventoryItemDetail inventoryItemId="9021" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9022" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-2" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9022" activationNumber="9022"/>
    <InventoryItemDetail inventoryItemId="9022" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9023" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9023" activationNumber="9023"/>
    <InventoryItemDetail inventoryItemId="9023" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9024" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9024" activationNumber="9024"/>
    <InventoryItemDetail inventoryItemId="9024" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>

4. good luck, if there is any problem please let me know.

      was (Author: jack_guo):
    the other configuration to let ofbiz work with the db2
1.change the database pagesize to 16k
2.add two fk-name to two entity's relation, one is PartyInvitationGroupAssoc 
the other is PartyInvitationRoleAssoc:
<entity entity-name="PartyInvitationGroupAssoc"
            package-name="org.ofbiz.party.party"
            title="Party Invitation Group Assoc Entity">
        <field name="partyInvitationId" type="id-ne"></field>
        <field name="partyIdTo" type="id-ne"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="partyIdTo"/>
        <relation type="one" title="To" rel-entity-name="PartyGroup">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" title="To" rel-entity-name="Party">
            <key-map field-name="partyIdTo" rel-field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="PTY_INT_GA_PTY_INT" 
rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
    <entity entity-name="PartyInvitationRoleAssoc"
            package-name="org.ofbiz.party.party"
            title="Party Invitation Role Assoc Entity">
        <field name="partyInvitationId" type="id-ne"></field>
        <field name="roleTypeId" type="id-ne"></field>
        <prim-key field="partyInvitationId"/>
        <prim-key field="roleTypeId"/>
        <relation type="one" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="PTY_INT_RA_PTY_INT" 
rel-entity-name="PartyInvitation">
            <key-map field-name="partyInvitationId"/>
        </relation>
    </entity>
this avoid the same fk-name problems. I think it's the better way we need add 
the fk-name if there is more than one relation with the same entity.
3.the INVITEM_SOFID and INVITEM_ACTNM index is unique in InventoryItem entity, 
but The demo data do not include the unique data. so, when insert the data It 
will thrown exeception, it happen in DemoProduct.xml, I add the data like this:

  <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" 
        inventoryItemId="9000" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="2.5" 
softIdentifier="9000" activationNumber="9000"/>
    <InventoryItemDetail inventoryItemId="9000" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="500" 
quantityOnHandDiff="500"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01" 
        inventoryItemId="9001" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="2.5"  
softIdentifier="9001" activationNumber="9001"/>
    <InventoryItemDetail inventoryItemId="9001" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" 
quantityOnHandDiff="5"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL02" 
        inventoryItemId="9002" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="3.0"  
softIdentifier="9002" activationNumber="9002"/>
    <InventoryItemDetail inventoryItemId="9002" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="15" 
quantityOnHandDiff="15"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL02" 
        inventoryItemId="9003" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="3.0"  
softIdentifier="9003" activationNumber="9003"/>
    <InventoryItemDetail inventoryItemId="9003" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="3" 
quantityOnHandDiff="3"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL03" 
        inventoryItemId="9004" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="4.5"  
softIdentifier="9004" activationNumber="9004"/>
    <InventoryItemDetail inventoryItemId="9004" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="50" 
quantityOnHandDiff="50"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL03" 
        inventoryItemId="9005" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="4.5"  
softIdentifier="9005" activationNumber="9005"/>
    <InventoryItemDetail inventoryItemId="9005" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" 
quantityOnHandDiff="5"/>
    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL04" 
        inventoryItemId="9006" inventoryItemTypeId="NON_SERIAL_INV_ITEM" 
productId="WG-5569" ownerPartyId="Company" currencyUomId="USD" unitCost="5.0"  
softIdentifier="9006" activationNumber="9006"/>
    <InventoryItemDetail inventoryItemId="9006" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>

    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9010" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9010" activationNumber="9010"/>
    <InventoryItemDetail inventoryItemId="9010" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9011" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9011" activationNumber="9011"/>
    <InventoryItemDetail inventoryItemId="9011" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9012" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9012" activationNumber="9012"/>
    <InventoryItemDetail inventoryItemId="9012" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9013" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="3.5"  
softIdentifier="9013" activationNumber="9013"/>
    <InventoryItemDetail inventoryItemId="9013" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" 
quantityOnHandDiff="10"/>

    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9021" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-1" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9021" activationNumber="9021"/>
    <InventoryItemDetail inventoryItemId="9021" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9022" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-2" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9022" activationNumber="9022"/>
    <InventoryItemDetail inventoryItemId="9022" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9023" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-3" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9023" activationNumber="9023"/>
    <InventoryItemDetail inventoryItemId="9023" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>
    <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9024" 
inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-4" 
ownerPartyId="Company" currencyUomId="USD" unitCost="2.4"  
softIdentifier="9024" activationNumber="9024"/>
    <InventoryItemDetail inventoryItemId="9024" inventoryItemDetailSeqId="0001" 
effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" 
quantityOnHandDiff="8"/>

4. good luck, if there is any problem please let me know.
  
> let the ofbiz work with db2
> ---------------------------
>
>                 Key: OFBIZ-1607
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1607
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: db2 v9.1.0.356
>            Reporter: WeizhanGuo
>             Fix For: SVN trunk
>
>         Attachments: fieldtypedb2.xml
>
>   Original Estimate: 0.67h
>  Remaining Estimate: 0.67h
>
> create the db2filedtype file ; 
> change the seed/demo data to fixed the db2 requirement;
> change some relation define if needed;
> others

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to