geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Upgrading 1.1 EAR to 2.1 - OpenEJB 3 CMP/CMR Issues
Date Fri, 05 Dec 2008 07:47:18 GMT
Hi Mark,

Unfortunately I don't actually know what I'm talking about here in any  
detail.... Dain would know more.  However I have a few suggestions:

1. We set the following properties in persistence.xml by default: if  
you want something different you should override them:

             openjpa.Log=commons
              
openjpa.jdbc.DBDictionary=org.apache.openjpa.jdbc.sql.DerbyDictionary
              
openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
             openjpa.jdbc.UpdateManager=operation-order
             openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)


in particular the DBDictionary may be causing problems.  I'm not sure  
whether the other properties might have more appropriate values.  You  
can override these in your persistence.xml (in the appropriate format  
-- these are not actually from a "default persistence.xml" but from a  
gbean config)

2. By all means try a more recent mysql driver.

3. MySql used to have rather bizarre ideas about sql.  Trying another  
database as an experiment might be useful.

4. Just in case you aren't currently, letting openjpa create the  
tables for you at least as an experiment might be informative.

The tck has a bunch of ejb 2.1 cmp/cmr tests and they all work fine so  
at least a lot of it is verified to work propertly.

Please let us know your progress.

thanks
david jencks


On Dec 4, 2008, at 10:49 PM, Mark Aufdencamp wrote:

> Hi All,
>
> I'm upgrading an EAR from G 1.1.1-Win32-Tomcat to G 2.1.3-Linux- 
> Tomcat.
> I've successfully installed G 2.1 and managed to deploy my Database
> Pools and Security Realms. I've edited my geonimo-application.xml and
> openejb-jar.xml to reflect the new deployment plan name space.  I've
> managed to successfully deploy the EAR on the server. I even managed  
> to
> migrate my databases to the new server after learning some MySQL
> intricacies of Win32 vs Linux table and column name case sensitivity.
>
> I can access my application and login via the defined JDBC Security
> Realm.  Now the good stuff.  It has an EJB 2.1 CMP/CMR component that
> gets wrapped by OpenJPA in OpenEJB 3.  No problem, it should work,
> right?
>
> I receive an OpenJPA PersistenceException when first accessing the
> EntityBean from a Session Bean (I will double check the authenticity  
> of
> this location, I believe it's an initial EJB Query).  OpenJPA spits  
> out
> a generated SQL Statement that it doesn't like.  It appears to be an
> OpenJPA Syntax check of a "SHOW CREATE TABLE TableName;"  It
> incorporates a MySQL specific table command ( TYPE = "InnoDB" ).  This
> might pass validation if it were the newer MySQL syntax - ENGINE =
> "InnoDB".  The newest MySQL 5 Driver rather than the installed 3.1.12
> from the Geronimo Driver Repository might fix this.  Poking around and
> setting the MySQL sql_mode to ANSI seems to resolve this problem and
> will probably be more compatible with the default Derby SQL statement
> builder and syntax checker.  So, I should hopefully be SQL dialect
> neutral at this point.
>
> Now I can retrieve a query of the Entities to display, but the CMR
> component seems to be broken.  I have a Null Pointer Exception  
> generated
> in the OpenEJB BaseEjbProxyHandler class with the CMR method  
> identified.
> Further up the stack, SetValuedCmr in openejb.core.cmp.cmp2 is
> identified as the culprit.  It appears that the CMR methods are broken
> and not capable of constructing the necessary queries.
>
> Am I missing something in the deployment descriptors to do CMP/CMR in
> OpenEJB 3?
>
> Do I need to setup some persistence information in open-ejb.xml for  
> CMP
> to run in OpenEJB 3?
>
> Does a MySQL specific QL driver exist for G 2.1/OpenEJB 3?
>
> I haven't found any specific discussion of running CMP/CMR from G  
> 1.1 in
> G 2.1.  Does it exist or do I get to be the guy:)
>
> TIA for the help and guidance,
>
> Mark Aufdencamp
> Mark@Aufdencamp.com
>


Mime
View raw message