Login  Register

Re: db2 express-c and ofbiz

Posted by Jason Lane-2 on Nov 02, 2006; 3:57am
URL: http://ofbiz.116.s1.nabble.com/db2-express-c-and-ofbiz-tp142441p142456.html

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