Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: framework
    • Labels:
      None
    • Environment:

      db2 v9.1.0.356

      Description

      create the db2filedtype file ;
      change the seed/demo data to fixed the db2 requirement;
      change some relation define if needed;
      others

      1. contentForm.diff
        0.6 kB
        WeizhanGuo
      2. entityFordb2.diff
        77 kB
        WeizhanGuo

        Activity

        Hide
        WeizhanGuo added a comment - - edited

        please read this first: http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration
        it mentions two bugs in this article , the first one can fixed by lookup of primary keys by each table which the DatabaseUtil has been done(the db2 v9.5 has been solved this problem). the second is the DB2 jdbc can not support the scrollable resultset with lob datatype, i think there is no good way to fix this problem if there is not a better db2 jdbc driver, the EntityListIterator need a scrollable resultset, please tell me if you have a better way to solve this problem, thanks.

        Show
        WeizhanGuo added a comment - - edited please read this first: http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration it mentions two bugs in this article , the first one can fixed by lookup of primary keys by each table which the DatabaseUtil has been done(the db2 v9.5 has been solved this problem). the second is the DB2 jdbc can not support the scrollable resultset with lob datatype, i think there is no good way to fix this problem if there is not a better db2 jdbc driver, the EntityListIterator need a scrollable resultset, please tell me if you have a better way to solve this problem, thanks.
        Hide
        WeizhanGuo added a comment -

        the fieldType file

        Show
        WeizhanGuo added a comment - the fieldType file
        Hide
        WeizhanGuo added a comment - - edited

        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.

        Show
        WeizhanGuo added a comment - - edited 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.
        Hide
        BJ Freeman added a comment -

        it is easier to read and submit, what has changed if you submit this as a patch.

        Show
        BJ Freeman added a comment - it is easier to read and submit, what has changed if you submit this as a patch.
        Hide
        WeizhanGuo added a comment -

        I am not clear what your mean, but I submit this jira to make the ofbiz can support the DB2 out of box, what the changed? you can see the comment above.

        Show
        WeizhanGuo added a comment - I am not clear what your mean, but I submit this jira to make the ofbiz can support the DB2 out of box, what the changed? you can see the comment above.
        Hide
        Jacques Le Roux added a comment -

        Hi

        Could you send a patch against you entityengine.xml file ? To make a patch : http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

        Else send only your
        <datasource name="db2"....

        </datasource>
        block

        Thanks

        Show
        Jacques Le Roux added a comment - Hi Could you send a patch against you entityengine.xml file ? To make a patch : http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices Else send only your <datasource name="db2".... </datasource> block Thanks
        Hide
        WeizhanGuo added a comment -

        the current problem is the db2 don't support pull the clob data with cursor and the EntityListIterator work with cursored DB results, I try to create another class work like the EntityListIterator and don't need the cursored DB results.

        Show
        WeizhanGuo added a comment - the current problem is the db2 don't support pull the clob data with cursor and the EntityListIterator work with cursored DB results, I try to create another class work like the EntityListIterator and don't need the cursored DB results.
        Hide
        Jacques Le Roux added a comment -

        Guo,

        So do I wait for your work on this before commiting ?

        Show
        Jacques Le Roux added a comment - Guo, So do I wait for your work on this before commiting ?
        Hide
        WeizhanGuo added a comment -

        Have you done this before? if haven't I think it's better to wait couple of days, I'm trying to fix this problem, you can fix other issue in those days And I will let you know the result.

        Show
        WeizhanGuo added a comment - Have you done this before? if haven't I think it's better to wait couple of days, I'm trying to fix this problem, you can fix other issue in those days And I will let you know the result.
        Hide
        WeizhanGuo added a comment - - edited

        Hi Jacques,

        I have updated the lasted code I changed, I created a EntityListIterator without cursor, may be it's not the best way to fix this problem, but it can work now, if there is any problems please let me know.

        Show
        WeizhanGuo added a comment - - edited Hi Jacques, I have updated the lasted code I changed, I created a EntityListIterator without cursor, may be it's not the best way to fix this problem, but it can work now, if there is any problems please let me know.
        Hide
        BJ Freeman added a comment -

        I maybe off on my evaluation, but I think this needs to be looked at from a higher level of design.
        what does ofbiz do when the field def for the db are less than the entity field def.
        and how does the entity aware displays, validate the length so they fit the db field lengths.
        and when reading in data, like seed should not a error log be generated when the field lengths are longer than the db field lengths

        in the entityengine.xml there is a discussion about the SelectMethod=cursor. though not realted to db2 it may be the way to look for a long term solutions.
        using this parm will let each db define weather to use cursors or not, instead of writing db specific code.

        Show
        BJ Freeman added a comment - I maybe off on my evaluation, but I think this needs to be looked at from a higher level of design. what does ofbiz do when the field def for the db are less than the entity field def. and how does the entity aware displays, validate the length so they fit the db field lengths. and when reading in data, like seed should not a error log be generated when the field lengths are longer than the db field lengths in the entityengine.xml there is a discussion about the SelectMethod=cursor. though not realted to db2 it may be the way to look for a long term solutions. using this parm will let each db define weather to use cursors or not, instead of writing db specific code.
        Hide
        WeizhanGuo added a comment -

        the best solution is the db2 driver can support pull clob data with cursor , but it cann't, maybe it will in the future. as you say, that make all the select support cursor or not, it can make less code changed, but we also have to create a EntityListIterator without cursor, doesn't it?

        Show
        WeizhanGuo added a comment - the best solution is the db2 driver can support pull clob data with cursor , but it cann't, maybe it will in the future. as you say, that make all the select support cursor or not, it can make less code changed, but we also have to create a EntityListIterator without cursor, doesn't it?
        Hide
        BJ Freeman added a comment -

        First let me apologize for mis information.
        let me correct that
        ofbiz uses entity model to define a field and the length of that feild type is defined in fieldtypexxxxxxxx.xml. where the xxxxx is the db

        There should never be a field length longer that the db ability if the
        fieldtypexxxxxxxx field length is defined properly.

        any operation the relates to cursors should be checked for SelectMethod. if the driver does not provide this then it should be a parm in the entityengine.xml for each db.

        currently here is how the code handles non cursors

        // some databases don't support cursors, or other problems may happen, so if there is an error here log it and move on to get as much as possible
        try

        { values = delegator.findListIteratorByCondition(curEntityName, null, null, null, me.getPkFieldNames(), null); }

        catch (Exception entityEx)

        { results.add("["+fileNumber +"] [xxx] Error when writing " + curEntityName + ": " + entityEx); continue; }

        the problem is in db with millions of records this is stored in memory becomes the limiting factor without cursors.

        as far as the code you did I would suggest
        + if(helperName.toLowerCase().indexOf(db2Name) >-1 &&

        be looking at a parm that was set datasourceinfo.java
        that way it is universal.

        Show
        BJ Freeman added a comment - First let me apologize for mis information. let me correct that ofbiz uses entity model to define a field and the length of that feild type is defined in fieldtypexxxxxxxx.xml. where the xxxxx is the db There should never be a field length longer that the db ability if the fieldtypexxxxxxxx field length is defined properly. any operation the relates to cursors should be checked for SelectMethod. if the driver does not provide this then it should be a parm in the entityengine.xml for each db. currently here is how the code handles non cursors // some databases don't support cursors, or other problems may happen, so if there is an error here log it and move on to get as much as possible try { values = delegator.findListIteratorByCondition(curEntityName, null, null, null, me.getPkFieldNames(), null); } catch (Exception entityEx) { results.add("["+fileNumber +"] [xxx] Error when writing " + curEntityName + ": " + entityEx); continue; } the problem is in db with millions of records this is stored in memory becomes the limiting factor without cursors. as far as the code you did I would suggest + if(helperName.toLowerCase().indexOf(db2Name) >-1 && be looking at a parm that was set datasourceinfo.java that way it is universal.
        Hide
        BJ Freeman added a comment -

        in looking into the cursor situation
        you can use
        if (_connection instanceof CursorConnection) {}else{}
        for the listiterator;

        Show
        BJ Freeman added a comment - in looking into the cursor situation you can use if (_connection instanceof CursorConnection) {}else{} for the listiterator;
        Hide
        WeizhanGuo added a comment -

        sorry I have some misunderstand what you say, let me ask some question for why your say:
        1.
        -ofbiz uses entity model to define a field and the length of that feild type is defined in fieldtypexxxxxxxx.xml. where the xxxxx is the db

        -There should never be a field length longer that the db ability if the
        -fieldtypexxxxxxxx field length is defined properly.

        why your method the length of the field? there is not any problem for the length define in db2.

        2. it seems the db2 didn't work with SelectMethod, have you try to do this.

        3.
        -the problem is in db with millions of records this is stored in memory becomes the limiting factor without cursors.
        I notice this problem, that's why I not use all the select without cursor and no use the SelectMethod in global configuration.

        4.
        -you can use

        • if (_connection instanceof CursorConnection) {}else{}
          -for the listiterator;
          a little trivialism about this.

        thanks for your advise, I will try my best to improve this... may be need add some parameters...

        Show
        WeizhanGuo added a comment - sorry I have some misunderstand what you say, let me ask some question for why your say: 1. -ofbiz uses entity model to define a field and the length of that feild type is defined in fieldtypexxxxxxxx.xml. where the xxxxx is the db -There should never be a field length longer that the db ability if the -fieldtypexxxxxxxx field length is defined properly. why your method the length of the field? there is not any problem for the length define in db2. 2. it seems the db2 didn't work with SelectMethod, have you try to do this. 3. -the problem is in db with millions of records this is stored in memory becomes the limiting factor without cursors. I notice this problem, that's why I not use all the select without cursor and no use the SelectMethod in global configuration. 4. -you can use if (_connection instanceof CursorConnection) {}else{} -for the listiterator; a little trivialism about this. thanks for your advise, I will try my best to improve this... may be need add some parameters...
        Hide
        BJ Freeman added a comment -

        #1 addressed the question you had about UI length of field. since every length is define from
        #2-4 addressed :
        "the current problem is the db2 don't support pull the clob data with cursor and the EntityListIterator work with cursored DB results, I try to create another class work like the EntityListIterator and don't need the cursored DB results."

        #2 SelectMethod is in the JDBC url. if it is not there then :
        if (_connection instanceof CursorConnection) would be false
        The would be away to chose iif the following code used cursors or not.
        example:
        findOptions.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE);

        Note: you changes are mask buy the bulk delete and replace of the complete file instead of just those parts you change.
        if you could just show the changed part in the patch ti would be very helpful.

        I had the same problem when I first submitted.

        Show
        BJ Freeman added a comment - #1 addressed the question you had about UI length of field. since every length is define from #2-4 addressed : "the current problem is the db2 don't support pull the clob data with cursor and the EntityListIterator work with cursored DB results, I try to create another class work like the EntityListIterator and don't need the cursored DB results." #2 SelectMethod is in the JDBC url. if it is not there then : if (_connection instanceof CursorConnection) would be false The would be away to chose iif the following code used cursors or not. example: findOptions.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); Note: you changes are mask buy the bulk delete and replace of the complete file instead of just those parts you change. if you could just show the changed part in the patch ti would be very helpful. I had the same problem when I first submitted.
        Hide
        Jacques Le Roux added a comment -

        WeizhanGuo,

        I wonder if you had previously a look at http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration ?

        Show
        Jacques Le Roux added a comment - WeizhanGuo, I wonder if you had previously a look at http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration ?
        Hide
        WeizhanGuo added a comment -

        yes, I have read this before, but this article did not solve the problems about DB2, the current problem is DB2 cann't pull the clob data with cursor, and my solution is the temp way that can work for some special projects, I still trying to found out the best way to fix the problem in product way, any advise are welcome.

        Show
        WeizhanGuo added a comment - yes, I have read this before, but this article did not solve the problems about DB2, the current problem is DB2 cann't pull the clob data with cursor, and my solution is the temp way that can work for some special projects, I still trying to found out the best way to fix the problem in product way, any advise are welcome.
        Hide
        Si Chen added a comment -

        Weizhan,

        I spent some time looking at this, and I've posted my comments here: http://www.opentaps.org/docs/index.php/Database_Tips#DB2_Tips

        You are correct--that wiki page does not solve the problem, nor do the other mailing list posts I've seen. There is no solution per se, but there are a few workarounds.

        Show
        Si Chen added a comment - Weizhan, I spent some time looking at this, and I've posted my comments here: http://www.opentaps.org/docs/index.php/Database_Tips#DB2_Tips You are correct--that wiki page does not solve the problem, nor do the other mailing list posts I've seen. There is no solution per se, but there are a few workarounds.
        Hide
        BJ Freeman added a comment -

        Si:
        if your going to provide support thru this systems
        it should go on the ofbiz wiki
        http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration
        This is what confuses people that ofbiz and opentaps are the same.

        Show
        BJ Freeman added a comment - Si: if your going to provide support thru this systems it should go on the ofbiz wiki http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration This is what confuses people that ofbiz and opentaps are the same.
        Hide
        David E. Jones added a comment -

        Be nice BJ...

        There will probably always be confusion but it's great to see collaboration and cooperation.

        Show
        David E. Jones added a comment - Be nice BJ... There will probably always be confusion but it's great to see collaboration and cooperation.
        Hide
        Jacques Le Roux added a comment -

        Yes, you are welcome Si.

        But I also agree with BJ, as much as possible please use the Wiki (http://docs.ofbiz.org/display/OFBIZ is open to everyone)

        Thanks for your appreciated collaboration !

        Show
        Jacques Le Roux added a comment - Yes, you are welcome Si. But I also agree with BJ, as much as possible please use the Wiki ( http://docs.ofbiz.org/display/OFBIZ is open to everyone) Thanks for your appreciated collaboration !

          People

          • Assignee:
            Unassigned
            Reporter:
            WeizhanGuo
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 40m
              40m
              Remaining:
              Remaining Estimate - 40m
              40m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development