On Jul 7, 2009, at 12:50 PM, David Jencks wrote:
>
> On Jul 7, 2009, at 11:29 AM, Mark Aufdencamp wrote:
>
>> First off, Thanks to all of you for Geronimo. I know you all work
>> very
>> hard to put out a great open source product.
>>
>> I've recently, with the release of G 2.1.4 that incorporates OpenJPA
>> 1.2, been able to move onto the G2 platform with a Java 6 JVM. I had
>> some real issues trying to utilize G2 through G 2.1.3 due to MySQL,
>> OpenJPA, and EJB 2.1 CMP not playing nicely together. (See posts
>> from
>> Dec 2008 -
>>
http://mail-archives.apache.org/mod_mbox/geronimo-user/200812.mbox/%3C20081206134911.181451e9c2a7ebbcd6ae28cea81146c8.79b7308154.wbe@...%3E)
>>
>> It appears that EJB 2.1 CMP works with G 2.1.4 , OpenJPA 1.2, and
>> MySQL. I've definitely needed to set the MySQL GLOBAL.sql_mode =
>> 'ANSI', and have been successfully running an EJB 2.1 CMP
>> application in
>> development and testing for the last 6-8 weeks. However, I ran
>> into the
>> old exception today (Persistence Exception - Syntax Error - TYPE =
>> innodb) in OpenJPA. This should have been covered by the global
>> setting
>> and I'm not sure why it was generated. I realize it's an OpenJPA
>> issue
>> rather than a Geronimo issue. I also realize that the MySQL JDBC
>> driver
>> does some odd things with it's schema information that help create
>> this
>> problem.
>>
>> I believe that setting the appropriate DBDictionary in OpenJPA's
>> persistence.xml would resolve this problem. In G2.1/OpenEJB3 the
>> persistence.xml is automatically generated at deployment time with
>> the
>> EJB 3 proxy classes for the 2.1 CMP EntityBeans.
>>
>> What I'd really like to know is how to set the
>> openjpa.jdbc.DBDictionary
>> to a MySQL setting in the persistence.xml when utilizing CMP 2.1 in
>> Geronimo.
>>
>> How does one override/supplement the generated persistence.xml?
>
> I don't know but I have 2 ideas to try...
>
> 1. What happens if you take the generated persistence.xml file and
> actually put it in the app, suitably edited? Will openejb3 use it?
This approach should work. If there's a "cmp" persistence-unit
declaration in the persistence.xml we should use that one instead of
generating one.
Let us know if it does not work as that would be a bug. The code is
definitely there to do it[1].
-David
[1] Line 94 of
http://svn.apache.org/viewvc/openejb/tags/openejb-3.0.1/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java?annotate=752772