db2 express-c and ofbiz

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

db2 express-c and ofbiz

Jason Lane-2
I have just started looking at the OFBiz project as a replacement (or complimentary offering) for some other eCommerce solutions that we currently offer to our customers. My goal is to take the OFBiz project and getit up and running on some of the open source solutions that are the entry points for our higher end options to our customers (We offer higher end DB2 and WebSphere deployments currently, so I want to base OFBiz on DB2 Express-C and Websphere Community Edition, AKA geronimo).

I have managed to get OFBiz up and running fine with Derby and the embedded jetty/geronimo app server, and now I want to move over to db2 and Websphere CE. So I have two issues/questions:

1) The out of the box ant script that seeds the database fails due to the name of the primary keys on many of the tables that it tries to create. DB2 only allows 18 chars and so it fails. I saw a few pages in a google search I did that talked about this being a problem, but I did not see a solution and some of those posts were from 2002. Has anyone managed a work around for this? If not, I guess I will have to start modifying the scripts to shorten the primary key names and just assume that it won't be an issue as long as the tables exist (meaning the code is not referencing those PK names directly).

2) Has anyone done any work on getting OFBiz to work under WebSphere CE or WebSphere in general? I have not looked at depth into the layout of all the pieces of the project, but I was planning on trying to migrate the layout into a standard EAR structure (based on Websphere base practices for file and directory locations, etc). The goal would be to create an EAR that could be deployed to WebSphere CE but would just as easily be deployed to a full WebSphere server.




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2

On Nov 1, 2006, at 3:16 PM, Jason Lane wrote:

> I have just started looking at the OFBiz project as a replacement  
> (or complimentary offering) for some other eCommerce solutions that  
> we currently offer to our customers. My goal is to take the OFBiz  
> project and getit up and running on some of the open source  
> solutions that are the entry points for our higher end options to  
> our customers (We offer higher end DB2 and WebSphere deployments  
> currently, so I want to base OFBiz on DB2 Express-C and Websphere  
> Community Edition, AKA geronimo).
>
> I have managed to get OFBiz up and running fine with Derby and the  
> embedded jetty/geronimo app server, and now I want to move over to  
> db2 and Websphere CE. So I have two issues/questions:
>
> 1) The out of the box ant script that seeds the database fails due  
> to the name of the primary keys on many of the tables that it tries  
> to create. DB2 only allows 18 chars and so it fails. I saw a few  
> pages in a google search I did that talked about this being a  
> problem, but I did not see a solution and some of those posts were  
> from 2002. Has anyone managed a work around for this? If not, I  
> guess I will have to start modifying the scripts to shorten the  
> primary key names and just assume that it won't be an issue as long  
> as the tables exist (meaning the code is not referencing those PK  
> names directly).

There is an attribute on the datasource element in the  
entityengine.xml file called "constraint-name-clip-length" that  
defaults to 30. If you set this to 18 it will automatically shorten  
the names. The trick is that the names may conflict at this point,  
unless DB2 does something helpful (most databases don't) and only  
requires constraint names to be locally unique, like relative to a  
table name or something. Anyway, you can try this and you'll see if  
it works pretty quickly...

> 2) Has anyone done any work on getting OFBiz to work under  
> WebSphere CE or WebSphere in general? I have not looked at depth  
> into the layout of all the pieces of the project, but I was  
> planning on trying to migrate the layout into a standard EAR  
> structure (based on Websphere base practices for file and directory  
> locations, etc). The goal would be to create an EAR that could be  
> deployed to WebSphere CE but would just as easily be deployed to a  
> full WebSphere server.

You could certainly try this. The main requirements for deploying  
OFBiz are:

1. JTA transaction manager (usually through JNDI)
2. JDBC datasource with connection pool (usually through JNDI)
3. mount a whole bunch of webapps
4. have a bunch of classpath resources that are shared between the  
webapps

The trick is #4. The EAR standard has nothing to add resources to the  
classpath that are shared between webapps, and that is required for  
certain parts of OFBiz. Certain app servers have proprietary  
extensions that allow you to do this (like Weblogic, for instance),  
but I don't know about Websphere or the IBM Geronimo variant.

-David

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Yeah, I figured out the entityengine.xml thing I actually added "use-pk-constraint-names" and set it to false, which seems to let DB2 generate internal the PK names. I assume that's ok.

I also set the clip length to 18 since that is the DB2.


WebSphere (the full server) does have something called shared libraries which allows libraries to be shared among a large number of webapps.

Also, couldn't all the required classes, resources, JARs, etc be placed in a client JAR and be put in the EAR manifest classpath? I know I've done that on other projects when I needed to shared classes or JARs between a number of webapps (all in the same EAR). At the time I was using WebSphere (not CE) so I'm not sure if Geronimo supports this but I thought it was J2EE spec? If you wanted to keep the resources outside of a JAR you could place all the resources at the EAR level and then all webapps would load the resources through the client JAR in the EAR.

I might be missing something, and I really haven't gone through the whole project yet, so I'm probably over-simplifying, but it seems doable to me. The one thing I don't want to do is I do not want to wind up moving a whole bunch of stuff around and then make it difficult to then get updates from the repository (without having to manually move everything again).

Oh well, I'm still trying to get DB2 Express-C setup (for some reason even after the ant build.xml creates all the tables and data, when I start the server the process seems to think the tables do not exist and they try to recreate. Still working on that one).


----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Wednesday, November 1, 2006 9:30:10 PM
Subject: Re: db2 express-c and ofbiz


On Nov 1, 2006, at 3:16 PM, Jason Lane wrote:

> I have just started looking at the OFBiz project as a replacement  
> (or complimentary offering) for some other eCommerce solutions that  
> we currently offer to our customers. My goal is to take the OFBiz  
> project and getit up and running on some of the open source  
> solutions that are the entry points for our higher end options to  
> our customers (We offer higher end DB2 and WebSphere deployments  
> currently, so I want to base OFBiz on DB2 Express-C and Websphere  
> Community Edition, AKA geronimo).
>
> I have managed to get OFBiz up and running fine with Derby and the  
> embedded jetty/geronimo app server, and now I want to move over to  
> db2 and Websphere CE. So I have two issues/questions:
>
> 1) The out of the box ant script that seeds the database fails due  
> to the name of the primary keys on many of the tables that it tries  
> to create. DB2 only allows 18 chars and so it fails. I saw a few  
> pages in a google search I did that talked about this being a  
> problem, but I did not see a solution and some of those posts were  
> from 2002. Has anyone managed a work around for this? If not, I  
> guess I will have to start modifying the scripts to shorten the  
> primary key names and just assume that it won't be an issue as long  
> as the tables exist (meaning the code is not referencing those PK  
> names directly).

There is an attribute on the datasource element in the  
entityengine.xml file called "constraint-name-clip-length" that  
defaults to 30. If you set this to 18 it will automatically shorten  
the names. The trick is that the names may conflict at this point,  
unless DB2 does something helpful (most databases don't) and only  
requires constraint names to be locally unique, like relative to a  
table name or something. Anyway, you can try this and you'll see if  
it works pretty quickly...

> 2) Has anyone done any work on getting OFBiz to work under  
> WebSphere CE or WebSphere in general? I have not looked at depth  
> into the layout of all the pieces of the project, but I was  
> planning on trying to migrate the layout into a standard EAR  
> structure (based on Websphere base practices for file and directory  
> locations, etc). The goal would be to create an EAR that could be  
> deployed to WebSphere CE but would just as easily be deployed to a  
> full WebSphere server.

You could certainly try this. The main requirements for deploying  
OFBiz are:

1. JTA transaction manager (usually through JNDI)
2. JDBC datasource with connection pool (usually through JNDI)
3. mount a whole bunch of webapps
4. have a bunch of classpath resources that are shared between the  
webapps

The trick is #4. The EAR standard has nothing to add resources to the  
classpath that are shared between webapps, and that is required for  
certain parts of OFBiz. Certain app servers have proprietary  
extensions that allow you to do this (like Weblogic, for instance),  
but I don't know about Websphere or the IBM Geronimo variant.

-David




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2

On Nov 1, 2006, at 8:57 PM, Jason Lane wrote:

> Oh well, I'm still trying to get DB2 Express-C setup (for some  
> reason even after the ant build.xml creates all the tables and  
> data, when I start the server the process seems to think the tables  
> do not exist and they try to recreate. Still working on that one).

It sounds like the JDBC driver doesn't support getting all table meta  
data in a single request. You may have to change this to get the  
tables one by one, which is a LOT slower (why we don't do it by  
default), but should work fine. This would probably require a code  
change to the DatabaseUtil.java file. If you make it configurable (ie  
a true/false attribute in the entityengine.xml file or something) I'd  
be happy to review this and get it into the OFBiz SVN.

-David

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Well, there's another issue too. On the Survey portion it seems that one of the SQL statements is using a cursor to perform it's select, and either by default or how it's configured it's using a scrollable insensitive cursor, but db2 does not seem to support retrieving some of the columns (mainly CLOBs it seems) that way. The db2 documentation basically says to remove those columns from the select, or don't use cursors. This is starting to get interesting.

I'll take a look at the metadata issue and see what I can come up with.

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Wednesday, November 1, 2006 10:10:30 PM
Subject: Re: db2 express-c and ofbiz


On Nov 1, 2006, at 8:57 PM, Jason Lane wrote:

> Oh well, I'm still trying to get DB2 Express-C setup (for some  
> reason even after the ant build.xml creates all the tables and  
> data, when I start the server the process seems to think the tables  
> do not exist and they try to recreate. Still working on that one).

It sounds like the JDBC driver doesn't support getting all table meta  
data in a single request. You may have to change this to get the  
tables one by one, which is a LOT slower (why we don't do it by  
default), but should work fine. This would probably require a code  
change to the DatabaseUtil.java file. If you make it configurable (ie  
a true/false attribute in the entityengine.xml file or something) I'd  
be happy to review this and get it into the OFBiz SVN.

-David




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2

Ah yes, lovely. You might want to try a commercial JDBC driver  
instead of the default DB2 one... Oracle had a bunch of problems like  
this a few years ago in their JDBC drivers that they have mostly now  
addressed, but for a long time in order to get a full JDBC spec  
implementation and avoid vendor lock-in we had to use a third party  
driven like the ones from Data Direct.

-David


On Nov 1, 2006, at 9:34 PM, Jason Lane wrote:

> Well, there's another issue too. On the Survey portion it seems  
> that one of the SQL statements is using a cursor to perform it's  
> select, and either by default or how it's configured it's using a  
> scrollable insensitive cursor, but db2 does not seem to support  
> retrieving some of the columns (mainly CLOBs it seems) that way.  
> The db2 documentation basically says to remove those columns from  
> the select, or don't use cursors. This is starting to get interesting.
>
> I'll take a look at the metadata issue and see what I can come up  
> with.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, November 1, 2006 10:10:30 PM
> Subject: Re: db2 express-c and ofbiz
>
>
> On Nov 1, 2006, at 8:57 PM, Jason Lane wrote:
>
>> Oh well, I'm still trying to get DB2 Express-C setup (for some
>> reason even after the ant build.xml creates all the tables and
>> data, when I start the server the process seems to think the tables
>> do not exist and they try to recreate. Still working on that one).
>
> It sounds like the JDBC driver doesn't support getting all table meta
> data in a single request. You may have to change this to get the
> tables one by one, which is a LOT slower (why we don't do it by
> default), but should work fine. This would probably require a code
> change to the DatabaseUtil.java file. If you make it configurable (ie
> a true/false attribute in the entityengine.xml file or something) I'd
> be happy to review this and get it into the OFBiz SVN.
>
> -David
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: db2 express-c and ofbiz

Jean-Sebastien Hederer-2
In reply to this post by Jason Lane-2
Do you use db2 express- 8.2 or 9.0? I tried 9.0 and didn't have had problems
with constraints names. In my memory, 9.0 comes with a new JDBC driver.

> -----Message d'origine-----
> De : David E Jones [mailto:[hidden email]]
> Envoye : jeudi 2 novembre 2006 05:52
> A : [hidden email]
> Objet : Re: db2 express-c and ofbiz
>
>
>
> Ah yes, lovely. You might want to try a commercial JDBC driver
> instead of the default DB2 one... Oracle had a bunch of
> problems like
> this a few years ago in their JDBC drivers that they have mostly now
> addressed, but for a long time in order to get a full JDBC spec
> implementation and avoid vendor lock-in we had to use a third party
> driven like the ones from Data Direct.
>
> -David
>
>
> On Nov 1, 2006, at 9:34 PM, Jason Lane wrote:
>
> > Well, there's another issue too. On the Survey portion it seems
> > that one of the SQL statements is using a cursor to perform it's
> > select, and either by default or how it's configured it's using a
> > scrollable insensitive cursor, but db2 does not seem to support
> > retrieving some of the columns (mainly CLOBs it seems) that way.
> > The db2 documentation basically says to remove those columns from
> > the select, or don't use cursors. This is starting to get
> interesting.
> >
> > I'll take a look at the metadata issue and see what I can come up
> > with.
> >
> > ----- Original Message ----
> > From: David E Jones <[hidden email]>
> > To: [hidden email]
> > Sent: Wednesday, November 1, 2006 10:10:30 PM
> > Subject: Re: db2 express-c and ofbiz
> >
> >
> > On Nov 1, 2006, at 8:57 PM, Jason Lane wrote:
> >
> >> Oh well, I'm still trying to get DB2 Express-C setup (for some
> >> reason even after the ant build.xml creates all the tables and
> >> data, when I start the server the process seems to think the tables
> >> do not exist and they try to recreate. Still working on that one).
> >
> > It sounds like the JDBC driver doesn't support getting all
> table meta
> > data in a single request. You may have to change this to get the
> > tables one by one, which is a LOT slower (why we don't do it by
> > default), but should work fine. This would probably require a code
> > change to the DatabaseUtil.java file. If you make it
> configurable (ie
> > a true/false attribute in the entityengine.xml file or
> something) I'd
> > be happy to review this and get it into the OFBiz SVN.
> >
> > -David
> >
> >
> >
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Yes, I'm using 9. Just downloaded it from IBM yesterday. The JDBC driver is listed as version 3.1.57.

I might go ahead and completely re-install DB2 and see if it clears up.

One thing I have not figured out yet. It seems that ofbiz supports sending properties for database connections (via a Properties object) but where can I change or add different properties? I wanted to play around with changing the cursor sensitivity, driver type, etc. I assume that the properties can be placed in a config file somewhere (either properties or XML) but the entityengine.xml doesn't seem to be the place.

----- Original Message ----
From: Jean-Sebastien Hederer <[hidden email]>
To: [hidden email]
Sent: Thursday, November 2, 2006 4:16:09 AM
Subject: RE: db2 express-c and ofbiz

Do you use db2 express- 8.2 or 9.0? I tried 9.0 and didn't have had problems
with constraints names. In my memory, 9.0 comes with a new JDBC driver.

> -----Message d'origine-----
> De : David E Jones [mailto:[hidden email]]
> Envoye : jeudi 2 novembre 2006 05:52
> A : [hidden email]
> Objet : Re: db2 express-c and ofbiz
>
>
>
> Ah yes, lovely. You might want to try a commercial JDBC driver
> instead of the default DB2 one... Oracle had a bunch of
> problems like
> this a few years ago in their JDBC drivers that they have mostly now
> addressed, but for a long time in order to get a full JDBC spec
> implementation and avoid vendor lock-in we had to use a third party
> driven like the ones from Data Direct.
>
> -David
>
>
> On Nov 1, 2006, at 9:34 PM, Jason Lane wrote:
>
> > Well, there's another issue too. On the Survey portion it seems
> > that one of the SQL statements is using a cursor to perform it's
> > select, and either by default or how it's configured it's using a
> > scrollable insensitive cursor, but db2 does not seem to support
> > retrieving some of the columns (mainly CLOBs it seems) that way.
> > The db2 documentation basically says to remove those columns from
> > the select, or don't use cursors. This is starting to get
> interesting.
> >
> > I'll take a look at the metadata issue and see what I can come up
> > with.
> >
> > ----- Original Message ----
> > From: David E Jones <[hidden email]>
> > To: [hidden email]
> > Sent: Wednesday, November 1, 2006 10:10:30 PM
> > Subject: Re: db2 express-c and ofbiz
> >
> >
> > On Nov 1, 2006, at 8:57 PM, Jason Lane wrote:
> >
> >> Oh well, I'm still trying to get DB2 Express-C setup (for some
> >> reason even after the ant build.xml creates all the tables and
> >> data, when I start the server the process seems to think the tables
> >> do not exist and they try to recreate. Still working on that one).
> >
> > It sounds like the JDBC driver doesn't support getting all
> table meta
> > data in a single request. You may have to change this to get the
> > tables one by one, which is a LOT slower (why we don't do it by
> > default), but should work fine. This would probably require a code
> > change to the DatabaseUtil.java file. If you make it
> configurable (ie
> > a true/false attribute in the entityengine.xml file or
> something) I'd
> > be happy to review this and get it into the OFBiz SVN.
> >
> > -David
> >
> >
> >
> >
>




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2

On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:

> One thing I have not figured out yet. It seems that ofbiz supports  
> sending properties for database connections (via a Properties  
> object) but where can I change or add different properties? I  
> wanted to play around with changing the cursor sensitivity, driver  
> type, etc. I assume that the properties can be placed in a config  
> file somewhere (either properties or XML) but the entityengine.xml  
> doesn't seem to be the place.

These can usually be added on the JDBC URI.

-David

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
You would think that. :) But when I try to add them I get a message about not being able to override the properties object settings, so I'm assuming it's pulling properties from somewhere. Sorry, I should have mentioned that they did not work from the db URI.

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Thursday, November 2, 2006 9:56:33 AM
Subject: Re: db2 express-c and ofbiz


On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:

> One thing I have not figured out yet. It seems that ofbiz supports  
> sending properties for database connections (via a Properties  
> object) but where can I change or add different properties? I  
> wanted to play around with changing the cursor sensitivity, driver  
> type, etc. I assume that the properties can be placed in a config  
> file somewhere (either properties or XML) but the entityengine.xml  
> doesn't seem to be the place.

These can usually be added on the JDBC URI.

-David




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Well, I have figured out why it was not able to get the table names. The code to look the tables in the DatabaseUtil is this:

dbData.getTables(null, lookupSchemaName, null, types);

But DB2 does work with that. If you change the line to this:

dbData.getTables(null, "%" , null , types);

It then works. I assume that this is because since I am logged in as the schema owner (login id and schema are the same) it is under the covers trying to look the specific schema inside of the schema.

Would it be worth while for me to add in a parameter to the entityengine.xml to allow for "%" instead of a specific schemaname lookup or is this something that already exists but I'm just missing it?

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Thursday, November 2, 2006 9:56:33 AM
Subject: Re: db2 express-c and ofbiz


On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:

> One thing I have not figured out yet. It seems that ofbiz supports  
> sending properties for database connections (via a Properties  
> object) but where can I change or add different properties? I  
> wanted to play around with changing the cursor sensitivity, driver  
> type, etc. I assume that the properties can be placed in a config  
> file somewhere (either properties or XML) but the entityengine.xml  
> doesn't seem to be the place.

These can usually be added on the JDBC URI.

-David




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Well, I actually found the proper way to fix this, without changing code. It turns out that the schema name needs to be all upper case since DB2 treats it as an ordinary identifier that must be uppercase. After I fixed that I was able to get the table names without changing any code.

Now it seems thee is something going on with the column info portion. When it tries to get the column information I get an error:

"Invalid getIndexInfo call: null not allowed for table name.. Not checking columns."

I guess I will need to debug and step through until I find why it's null. I'm guessing the ArrayList that holds the table names was maybe not resized to remove null identifiers and so it's getting a null on one of the calls, but I'll have to take a look.

Unless of course if someone else has seen this and knows what I'm doing wrong.

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Thursday, November 2, 2006 9:56:33 AM
Subject: Re: db2 express-c and ofbiz


On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:

> One thing I have not figured out yet. It seems that ofbiz supports  
> sending properties for database connections (via a Properties  
> object) but where can I change or add different properties? I  
> wanted to play around with changing the cursor sensitivity, driver  
> type, etc. I assume that the properties can be placed in a config  
> file somewhere (either properties or XML) but the entityengine.xml  
> doesn't seem to be the place.

These can usually be added on the JDBC URI.

-David




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jacopo Cappellato
Hi Jason,

all your notes are interesting and I guess that could be beneficial to
others that in the future will need to run OFBiz on db2; would you mind
collecting your notes in our documentation site?
Here is the link:

http://docs.ofbiz.org/homepage.action

You could put your notes in a new Wiki page here:

http://docs.ofbiz.org/pages/listpages-dirview.action?key=OFBIZ

or even create your own homepage (it is a very simple task) in the doc
site and add your notes there.

Thanks for sharing your experience with us.

Jacopo

Jason Lane wrote:

> Well, I actually found the proper way to fix this, without changing code. It turns out that the schema name needs to be all upper case since DB2 treats it as an ordinary identifier that must be uppercase. After I fixed that I was able to get the table names without changing any code.
>
> Now it seems thee is something going on with the column info portion. When it tries to get the column information I get an error:
>
> "Invalid getIndexInfo call: null not allowed for table name.. Not checking columns."
>
> I guess I will need to debug and step through until I find why it's null. I'm guessing the ArrayList that holds the table names was maybe not resized to remove null identifiers and so it's getting a null on one of the calls, but I'll have to take a look.
>
> Unless of course if someone else has seen this and knows what I'm doing wrong.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Thursday, November 2, 2006 9:56:33 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>
>> One thing I have not figured out yet. It seems that ofbiz supports  
>> sending properties for database connections (via a Properties  
>> object) but where can I change or add different properties? I  
>> wanted to play around with changing the cursor sensitivity, driver  
>> type, etc. I assume that the properties can be placed in a config  
>> file somewhere (either properties or XML) but the entityengine.xml  
>> doesn't seem to be the place.
>
> These can usually be added on the JDBC URI.
>
> -David
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2
In reply to this post by Jason Lane-2

Based on your description of the column problem I'd guess it is  
similar to another problem we talked about a bit ago. OFBiz sends  
null for the table name so that it can get back all column info in a  
single pass, rather than doing 700 round trips to the database. The  
time difference for most databases is a few seconds instead of a few  
minutes, so it makes a very big startup difference. I'm not sure this  
is the problem, but I'm guessing it is based on your description and  
that error message.

-David


On Nov 2, 2006, at 2:23 PM, Jason Lane wrote:

> Well, I actually found the proper way to fix this, without changing  
> code. It turns out that the schema name needs to be all upper case  
> since DB2 treats it as an ordinary identifier that must be  
> uppercase. After I fixed that I was able to get the table names  
> without changing any code.
>
> Now it seems thee is something going on with the column info  
> portion. When it tries to get the column information I get an error:
>
> "Invalid getIndexInfo call: null not allowed for table name.. Not  
> checking columns."
>
> I guess I will need to debug and step through until I find why it's  
> null. I'm guessing the ArrayList that holds the table names was  
> maybe not resized to remove null identifiers and so it's getting a  
> null on one of the calls, but I'll have to take a look.
>
> Unless of course if someone else has seen this and knows what I'm  
> doing wrong.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Thursday, November 2, 2006 9:56:33 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>
>> One thing I have not figured out yet. It seems that ofbiz supports
>> sending properties for database connections (via a Properties
>> object) but where can I change or add different properties? I
>> wanted to play around with changing the cursor sensitivity, driver
>> type, etc. I assume that the properties can be placed in a config
>> file somewhere (either properties or XML) but the entityengine.xml
>> doesn't seem to be the place.
>
> These can usually be added on the JDBC URI.
>
> -David
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
I just posted a page on the wiki. I'll update it as I run through some of the issues. Anyone who has any thoughts on some of the current issues please let me know or post to that page.

http://docs.ofbiz.org/display/OFBIZ/Entity+Engine+DB2+Express-C+integration

----- Original Message ----
From: Jacopo Cappellato <[hidden email]>
To: [hidden email]
Sent: Friday, November 3, 2006 12:22:10 AM
Subject: Re: db2 express-c and ofbiz

Hi Jason,

all your notes are interesting and I guess that could be beneficial to
others that in the future will need to run OFBiz on db2; would you mind
collecting your notes in our documentation site?
Here is the link:

http://docs.ofbiz.org/homepage.action

You could put your notes in a new Wiki page here:

http://docs.ofbiz.org/pages/listpages-dirview.action?key=OFBIZ

or even create your own homepage (it is a very simple task) in the doc
site and add your notes there.

Thanks for sharing your experience with us.

Jacopo

Jason Lane wrote:

> Well, I actually found the proper way to fix this, without changing code. It turns out that the schema name needs to be all upper case since DB2 treats it as an ordinary identifier that must be uppercase. After I fixed that I was able to get the table names without changing any code.
>
> Now it seems thee is something going on with the column info portion. When it tries to get the column information I get an error:
>
> "Invalid getIndexInfo call: null not allowed for table name.. Not checking columns."
>
> I guess I will need to debug and step through until I find why it's null. I'm guessing the ArrayList that holds the table names was maybe not resized to remove null identifiers and so it's getting a null on one of the calls, but I'll have to take a look.
>
> Unless of course if someone else has seen this and knows what I'm doing wrong.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Thursday, November 2, 2006 9:56:33 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>
>> One thing I have not figured out yet. It seems that ofbiz supports  
>> sending properties for database connections (via a Properties  
>> object) but where can I change or add different properties? I  
>> wanted to play around with changing the cursor sensitivity, driver  
>> type, etc. I assume that the properties can be placed in a config  
>> file somewhere (either properties or XML) but the entityengine.xml  
>> doesn't seem to be the place.
>
> These can usually be added on the JDBC URI.
>
> -David
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Yes, I saw in the code a TODO on the primary key section that mentions looping through the tables to get the primary keys for each. If I get some time I might add some code there to add that ability. Right now on DB2 it cannot get the primary keys for the various tables. I'm not sure if that actually will cause any problems since the primary keys are there, OFBiz just can't see them in that particular instance.

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Friday, November 3, 2006 12:46:43 AM
Subject: Re: db2 express-c and ofbiz


Based on your description of the column problem I'd guess it is  
similar to another problem we talked about a bit ago. OFBiz sends  
null for the table name so that it can get back all column info in a  
single pass, rather than doing 700 round trips to the database. The  
time difference for most databases is a few seconds instead of a few  
minutes, so it makes a very big startup difference. I'm not sure this  
is the problem, but I'm guessing it is based on your description and  
that error message.

-David


On Nov 2, 2006, at 2:23 PM, Jason Lane wrote:

> Well, I actually found the proper way to fix this, without changing  
> code. It turns out that the schema name needs to be all upper case  
> since DB2 treats it as an ordinary identifier that must be  
> uppercase. After I fixed that I was able to get the table names  
> without changing any code.
>
> Now it seems thee is something going on with the column info  
> portion. When it tries to get the column information I get an error:
>
> "Invalid getIndexInfo call: null not allowed for table name.. Not  
> checking columns."
>
> I guess I will need to debug and step through until I find why it's  
> null. I'm guessing the ArrayList that holds the table names was  
> maybe not resized to remove null identifiers and so it's getting a  
> null on one of the calls, but I'll have to take a look.
>
> Unless of course if someone else has seen this and knows what I'm  
> doing wrong.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Thursday, November 2, 2006 9:56:33 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>
>> One thing I have not figured out yet. It seems that ofbiz supports
>> sending properties for database connections (via a Properties
>> object) but where can I change or add different properties? I
>> wanted to play around with changing the cursor sensitivity, driver
>> type, etc. I assume that the properties can be placed in a config
>> file somewhere (either properties or XML) but the entityengine.xml
>> doesn't seem to be the place.
>
> These can usually be added on the JDBC URI.
>
> -David
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

David E Jones-2

You should be able to get away without the primary key information, I  
think this is only used right now to check database PK definitions  
against the application level ones in the entity model. That's a  
handy feature, but not necessary. In fact, I think there's an  
attribute on the datasource element to tell it to not even check the  
pks.

-David


On Nov 3, 2006, at 12:30 AM, Jason Lane wrote:

> Yes, I saw in the code a TODO on the primary key section that  
> mentions looping through the tables to get the primary keys for  
> each. If I get some time I might add some code there to add that  
> ability. Right now on DB2 it cannot get the primary keys for the  
> various tables. I'm not sure if that actually will cause any  
> problems since the primary keys are there, OFBiz just can't see  
> them in that particular instance.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Friday, November 3, 2006 12:46:43 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> Based on your description of the column problem I'd guess it is
> similar to another problem we talked about a bit ago. OFBiz sends
> null for the table name so that it can get back all column info in a
> single pass, rather than doing 700 round trips to the database. The
> time difference for most databases is a few seconds instead of a few
> minutes, so it makes a very big startup difference. I'm not sure this
> is the problem, but I'm guessing it is based on your description and
> that error message.
>
> -David
>
>
> On Nov 2, 2006, at 2:23 PM, Jason Lane wrote:
>
>> Well, I actually found the proper way to fix this, without changing
>> code. It turns out that the schema name needs to be all upper case
>> since DB2 treats it as an ordinary identifier that must be
>> uppercase. After I fixed that I was able to get the table names
>> without changing any code.
>>
>> Now it seems thee is something going on with the column info
>> portion. When it tries to get the column information I get an error:
>>
>> "Invalid getIndexInfo call: null not allowed for table name.. Not
>> checking columns."
>>
>> I guess I will need to debug and step through until I find why it's
>> null. I'm guessing the ArrayList that holds the table names was
>> maybe not resized to remove null identifiers and so it's getting a
>> null on one of the calls, but I'll have to take a look.
>>
>> Unless of course if someone else has seen this and knows what I'm
>> doing wrong.
>>
>> ----- Original Message ----
>> From: David E Jones <[hidden email]>
>> To: [hidden email]
>> Sent: Thursday, November 2, 2006 9:56:33 AM
>> Subject: Re: db2 express-c and ofbiz
>>
>>
>> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>>
>>> One thing I have not figured out yet. It seems that ofbiz supports
>>> sending properties for database connections (via a Properties
>>> object) but where can I change or add different properties? I
>>> wanted to play around with changing the cursor sensitivity, driver
>>> type, etc. I assume that the properties can be placed in a config
>>> file somewhere (either properties or XML) but the entityengine.xml
>>> doesn't seem to be the place.
>>
>> These can usually be added on the JDBC URI.
>>
>> -David
>>
>>
>>
>>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: db2 express-c and ofbiz

Jason Lane-2
In reply to this post by Jason Lane-2
Yeah, that is what I thought, although my personal goal is to make it as close to 100% functional as possible with DB2 so I will keep plugging away and try to make it work.

----- Original Message ----
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Friday, November 3, 2006 1:41:35 AM
Subject: Re: db2 express-c and ofbiz


You should be able to get away without the primary key information, I  
think this is only used right now to check database PK definitions  
against the application level ones in the entity model. That's a  
handy feature, but not necessary. In fact, I think there's an  
attribute on the datasource element to tell it to not even check the  
pks.

-David


On Nov 3, 2006, at 12:30 AM, Jason Lane wrote:

> Yes, I saw in the code a TODO on the primary key section that  
> mentions looping through the tables to get the primary keys for  
> each. If I get some time I might add some code there to add that  
> ability. Right now on DB2 it cannot get the primary keys for the  
> various tables. I'm not sure if that actually will cause any  
> problems since the primary keys are there, OFBiz just can't see  
> them in that particular instance.
>
> ----- Original Message ----
> From: David E Jones <[hidden email]>
> To: [hidden email]
> Sent: Friday, November 3, 2006 12:46:43 AM
> Subject: Re: db2 express-c and ofbiz
>
>
> Based on your description of the column problem I'd guess it is
> similar to another problem we talked about a bit ago. OFBiz sends
> null for the table name so that it can get back all column info in a
> single pass, rather than doing 700 round trips to the database. The
> time difference for most databases is a few seconds instead of a few
> minutes, so it makes a very big startup difference. I'm not sure this
> is the problem, but I'm guessing it is based on your description and
> that error message.
>
> -David
>
>
> On Nov 2, 2006, at 2:23 PM, Jason Lane wrote:
>
>> Well, I actually found the proper way to fix this, without changing
>> code. It turns out that the schema name needs to be all upper case
>> since DB2 treats it as an ordinary identifier that must be
>> uppercase. After I fixed that I was able to get the table names
>> without changing any code.
>>
>> Now it seems thee is something going on with the column info
>> portion. When it tries to get the column information I get an error:
>>
>> "Invalid getIndexInfo call: null not allowed for table name.. Not
>> checking columns."
>>
>> I guess I will need to debug and step through until I find why it's
>> null. I'm guessing the ArrayList that holds the table names was
>> maybe not resized to remove null identifiers and so it's getting a
>> null on one of the calls, but I'll have to take a look.
>>
>> Unless of course if someone else has seen this and knows what I'm
>> doing wrong.
>>
>> ----- Original Message ----
>> From: David E Jones <[hidden email]>
>> To: [hidden email]
>> Sent: Thursday, November 2, 2006 9:56:33 AM
>> Subject: Re: db2 express-c and ofbiz
>>
>>
>> On Nov 2, 2006, at 7:38 AM, Jason Lane wrote:
>>
>>> One thing I have not figured out yet. It seems that ofbiz supports
>>> sending properties for database connections (via a Properties
>>> object) but where can I change or add different properties? I
>>> wanted to play around with changing the cursor sensitivity, driver
>>> type, etc. I assume that the properties can be placed in a config
>>> file somewhere (either properties or XML) but the entityengine.xml
>>> doesn't seem to be the place.
>>
>> These can usually be added on the JDBC URI.
>>
>> -David
>>
>>
>>
>>
>
>
>
>