[jira] Created: (OFBIZ-1607) let the ofbiz work with db2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)

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

WeizhanGuo commented on OFBIZ-1607:
-----------------------------------

Hi Jacques,

I update the lasted code I changed, I create 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.

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

jack_guo edited comment on OFBIZ-1607 at 2/21/08 8:45 PM:
------------------------------------------------------------

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.

      was (Author: jack_guo):
    Hi Jacques,

I update the lasted code I changed, I create 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.
 

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

BJ Freeman commented on OFBIZ-1607:
-----------------------------------

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.



> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

WeizhanGuo commented on OFBIZ-1607:
-----------------------------------

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?  

 

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

BJ Freeman commented on OFBIZ-1607:
-----------------------------------

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.



> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

BJ Freeman commented on OFBIZ-1607:
-----------------------------------

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


> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

WeizhanGuo commented on OFBIZ-1607:
-----------------------------------

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...
 





> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

BJ Freeman commented on OFBIZ-1607:
-----------------------------------

#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. :)



> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux commented on OFBIZ-1607:
----------------------------------------

WeizhanGuo,

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

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

WeizhanGuo commented on OFBIZ-1607:
-----------------------------------

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.

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-1607:
--------------------------------------

    Assignee:     (was: Jacques Le Roux)

> 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: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Si Chen commented on OFBIZ-1607:
--------------------------------

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.

> 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: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

BJ Freeman commented on OFBIZ-1607:
-----------------------------------

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.


> 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: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

David E. Jones commented on OFBIZ-1607:
---------------------------------------

Be nice BJ...

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

> 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: contentForm.diff, entityFordb2.diff
>
>   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 | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1607) let the ofbiz work with db2

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux commented on OFBIZ-1607:
----------------------------------------

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 !

> 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: contentForm.diff, entityFordb2.diff
>
>   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.

12