You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by joe <fi...@yahoo.de> on 2010/10/28 15:58:04 UTC

SAP MaxDB not supported?

Hi,

i use OpenJPA(1.2.1) with OpenEJB(3.1.2).
I know OpenJPA does not support automatic table creation from entities 
for SAP MaxDB. So i create the tables manually before using JPA.
Using JPA for reading/manipulating table content works here perfectly 
even for SAP MaxDB many times.
But yesterday i had one installation where it doesn't work.
When calling an EJB this installation produces the stack trace at the 
end of this email.

Why does the EJB call works normally but not this time?
For another installation, same versions of OpenJPA, OpenEJB, and SAP 
MaxDB, everything works fine.


The database product "SAP DB", version "KERNEL    7.6.03   BUILD 
015-123-173-107" is not officially supported.
                 at 
org.apache.openjpa.jdbc.sql.DB2Dictionary.connectedConfiguration(DB2Dictionary.java:278)
                 at 
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:158)
                 at 
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:99)
                 at 
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:562)
                 at 
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1265)
                 at 
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
                 at 
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
                 at 
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
                 at 
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
                 at 
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
                 at 
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:863)
                 at 
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:854)
                 at 
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
                 at 
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
                 at 
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
                 at 
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
                 at 
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
                 at 
org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:105)
                 at 
org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:61)
                 at 
org.apache.openejb.persistence.JtaEntityManager.createQuery(JtaEntityManager.java:173)
...

Re: SAP MaxDB not supported?

Posted by Michael Dick <mi...@gmail.com>.
You're welcome, thanks for letting us know it worked.

-mike

On Mon, Nov 22, 2010 at 9:41 AM, joe <fi...@yahoo.de> wrote:

> Hi,
>
>
>  I've committed the code changes and a section to the user manual. Could
>> use
>> the class name for the JDBC driver, and some version information for the
>> manual, but function wise you should be good to go once we publish a new
>> SNAPSHOT build.
>>
>
> I downloaded the 2.1.0 snapshot and found the added MaxDBDictonary class.
> Cause i can only use openjpa 1.2.1 with OpenEJB in a Java 1.5 environemnt,
> i recompiled the class for 1.5 and added it to the
> openjpa-1.2.1.jar shipped with OpenEJB then i edited the persistence.xml
> <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.MaxDBDictionary" />
>
> And it works!
> I did some tests (simple CRUDs) and had no problems.
> As described in the MaxDBDictonary class, currently its just
> a placeholder.
> So for production i will use
>
> <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.DBDictionary" />
> so i dont have to patch the openjpa-1.2.1.jar with the new class.
>
> Thx for your help.
>
>
>
>
>

Re: SAP MaxDB not supported?

Posted by joe <fi...@yahoo.de>.
Hi,

> I've committed the code changes and a section to the user manual. Could use
> the class name for the JDBC driver, and some version information for the
> manual, but function wise you should be good to go once we publish a new
> SNAPSHOT build.

I downloaded the 2.1.0 snapshot and found the added MaxDBDictonary class.
Cause i can only use openjpa 1.2.1 with OpenEJB in a Java 1.5 
environemnt, i recompiled the class for 1.5 and added it to the
openjpa-1.2.1.jar shipped with OpenEJB then i edited the persistence.xml
<property name="openjpa.jdbc.DBDictionary" 
value="org.apache.openjpa.jdbc.sql.MaxDBDictionary" />

And it works!
I did some tests (simple CRUDs) and had no problems.
As described in the MaxDBDictonary class, currently its just
a placeholder.
So for production i will use
<property name="openjpa.jdbc.DBDictionary" 
value="org.apache.openjpa.jdbc.sql.DBDictionary" />
so i dont have to patch the openjpa-1.2.1.jar with the new class.

Thx for your help.





Re: SAP MaxDB not supported?

Posted by Michael Dick <mi...@gmail.com>.
I've committed the code changes and a section to the user manual. Could use
the class name for the JDBC driver, and some version information for the
manual, but function wise you should be good to go once we publish a new
SNAPSHOT build.

Hudson is sick for us right now, so that might take a day. If you can pick
up a 2.1.0 snapshot next week and verify that I got it right that would be
appreciated.

-mike

On Wed, Nov 3, 2010 at 9:00 AM, Michael Dick <mi...@gmail.com>wrote:

> On Mon, Nov 1, 2010 at 3:58 AM, joe <fi...@yahoo.de> wrote:
>
>> Hi,
>>
>>
>>  I think (haven't verified it) that you can use the base DBDictionary
>>> class -
>>> this might be closer to MaxDB than Oracle or HSQL.
>>>
>>
>> Which value i have to set for using the base DBDictionary class?
>> <property name="openjpa.jdbc.DBDictionary" value="?"/>
>>
>
>
> Sorry, missed this reply and I'll confess I haven't tried it, but this
> _should_ work:
> <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.DBDictionary"/>
>
>
>>
>>  One other thing you / we can do is open a JIRA for supporting MaxDB, and
>>> we
>>> can add a MaxDB dictionary for you.
>>>
>>
>> created this one:
>> https://issues.apache.org/jira/browse/OPENJPA-1864
>>
>
> I'll take a look later this morning, should be pretty quick to add a class
> for MaxDB.
>
>
>
>>
>>  We wouldn't be able to do much (any)
>>> testing - unless MaxDB happens to be free, but we certainly could add a
>>> MaxDBDictionary for you.
>>>
>>
>> Sounds great, I would gladly test it.
>>
>>
>>  We'd want to know the format of the connection url, and a few other
>>> things
>>> but this should be fairly quick to include
>>>
>>
>> jdbc:sapdb://<server>:<port7210>/<database>
>>
>
> -mike
>

Re: SAP MaxDB not supported?

Posted by Michael Dick <mi...@gmail.com>.
On Mon, Nov 1, 2010 at 3:58 AM, joe <fi...@yahoo.de> wrote:

> Hi,
>
>
>  I think (haven't verified it) that you can use the base DBDictionary class
>> -
>> this might be closer to MaxDB than Oracle or HSQL.
>>
>
> Which value i have to set for using the base DBDictionary class?
> <property name="openjpa.jdbc.DBDictionary" value="?"/>
>


Sorry, missed this reply and I'll confess I haven't tried it, but this
_should_ work:
<property name="openjpa.jdbc.DBDictionary"
value="org.apache.openjpa.jdbc.sql.DBDictionary"/>


>
>  One other thing you / we can do is open a JIRA for supporting MaxDB, and
>> we
>> can add a MaxDB dictionary for you.
>>
>
> created this one:
> https://issues.apache.org/jira/browse/OPENJPA-1864
>

I'll take a look later this morning, should be pretty quick to add a class
for MaxDB.



>
>  We wouldn't be able to do much (any)
>> testing - unless MaxDB happens to be free, but we certainly could add a
>> MaxDBDictionary for you.
>>
>
> Sounds great, I would gladly test it.
>
>
>  We'd want to know the format of the connection url, and a few other things
>> but this should be fairly quick to include
>>
>
> jdbc:sapdb://<server>:<port7210>/<database>
>

-mike

Re: SAP MaxDB not supported?

Posted by joe <fi...@yahoo.de>.
Hi,

> I think (haven't verified it) that you can use the base DBDictionary class -
> this might be closer to MaxDB than Oracle or HSQL.

Which value i have to set for using the base DBDictionary class?
<property name="openjpa.jdbc.DBDictionary" value="?"/>

> One other thing you / we can do is open a JIRA for supporting MaxDB, and we
> can add a MaxDB dictionary for you.

created this one:
https://issues.apache.org/jira/browse/OPENJPA-1864

> We wouldn't be able to do much (any)
> testing - unless MaxDB happens to be free, but we certainly could add a
> MaxDBDictionary for you.

Sounds great, I would gladly test it.

> We'd want to know the format of the connection url, and a few other things
> but this should be fairly quick to include

jdbc:sapdb://<server>:<port7210>/<database>

Re: SAP MaxDB not supported?

Posted by Michael Dick <mi...@gmail.com>.
I think (haven't verified it) that you can use the base DBDictionary class -
this might be closer to MaxDB than Oracle or HSQL.

One other thing you / we can do is open a JIRA for supporting MaxDB, and we
can add a MaxDB dictionary for you. We wouldn't be able to do much (any)
testing - unless MaxDB happens to be free, but we certainly could add a
MaxDBDictionary for you.

We'd want to know the format of the connection url, and a few other things
but this should be fairly quick to include - so long as you realize we
haven't (and probably can't) do a lot of testing with it.

-mike

On Thu, Oct 28, 2010 at 11:05 AM, joe <fi...@yahoo.de> wrote:

> Hi Michael/Rick,
>
>
>  Minor clarification. OpenJPA does not include any support for MaxDB,
>> regardless of whether you're generating tables or reading / updating data.
>>
>
> Args.
>
>
>  That doesn't mean that it won't work, but you are off the beaten path.
>>
>
> ok, lets see.
>
>
>  OpenJPA uses different DBDictionary classes for each database (these are
>> similar to Hibernate's Dialect classes). If you do not specify one in your
>> persistence.xml file OpenJPA will take it's best guess based on the url
>> (among other things).
>>
>
> Yes did not specify it.
>
>
>  My guess (and I think Rick was heading in this direction too) is that in
>> the
>> non-working case OpenJPA chose the DB2Dictionary which is not compatible
>> with MaxDB. Take a look at the logs in your working environment and you
>> should see something like this :
>> 3597  mdr-pu  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
>> "org.apache.openjpa.jdbc. . ."
>>
>
> Ah ok, couldn't find any log entry, but i tested some DBDictionary values
> myself. "oracle" and "hsql" seems to work for SAP MaxDB in my case, but i
> have to do further testing.
>
>
>  It probably won't be the DB2Dictionary from Rick's email. You can set this
>> in persistence.xml by using the
>>
>
> yes definitly, db2 value does not work.
>
>
>  openjpa.jdbc.DBDictionary property name, with a value set to the class
>> that
>> you want to use.
>>
>
> thx.
>
>
>  As a short term workaround setting the DBDictionary to whatever you have
>> in
>> the working environments should work for you. For medium term, you'll
>> probably want to write your own DBDictionary for MaxDB (start by ext
>>
>
> ending DBDictionary?
>
> Thx
>

Re: SAP MaxDB not supported?

Posted by joe <fi...@yahoo.de>.
Hi Michael/Rick,

> Minor clarification. OpenJPA does not include any support for MaxDB,
> regardless of whether you're generating tables or reading / updating data.

Args.

> That doesn't mean that it won't work, but you are off the beaten path.

ok, lets see.

> OpenJPA uses different DBDictionary classes for each database (these are
> similar to Hibernate's Dialect classes). If you do not specify one in your
> persistence.xml file OpenJPA will take it's best guess based on the url
> (among other things).

Yes did not specify it.

> My guess (and I think Rick was heading in this direction too) is that in the
> non-working case OpenJPA chose the DB2Dictionary which is not compatible
> with MaxDB. Take a look at the logs in your working environment and you
> should see something like this :
> 3597  mdr-pu  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> "org.apache.openjpa.jdbc. . ."

Ah ok, couldn't find any log entry, but i tested some DBDictionary 
values myself. "oracle" and "hsql" seems to work for SAP MaxDB in my 
case, but i have to do further testing.

> It probably won't be the DB2Dictionary from Rick's email. You can set this
> in persistence.xml by using the

yes definitly, db2 value does not work.

> openjpa.jdbc.DBDictionary property name, with a value set to the class that
> you want to use.

thx.

> As a short term workaround setting the DBDictionary to whatever you have in
> the working environments should work for you. For medium term, you'll
> probably want to write your own DBDictionary for MaxDB (start by ext

ending DBDictionary?

Thx

Re: SAP MaxDB not supported?

Posted by Michael Dick <mi...@gmail.com>.
Minor clarification. OpenJPA does not include any support for MaxDB,
regardless of whether you're generating tables or reading / updating data.

That doesn't mean that it won't work, but you are off the beaten path.

OpenJPA uses different DBDictionary classes for each database (these are
similar to Hibernate's Dialect classes). If you do not specify one in your
persistence.xml file OpenJPA will take it's best guess based on the url
(among other things).

My guess (and I think Rick was heading in this direction too) is that in the
non-working case OpenJPA chose the DB2Dictionary which is not compatible
with MaxDB. Take a look at the logs in your working environment and you
should see something like this :
3597  mdr-pu  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc. . . "

It probably won't be the DB2Dictionary from Rick's email. You can set this
in persistence.xml by using the
openjpa.jdbc.DBDictionary property name, with a value set to the class that
you want to use.

As a short term workaround setting the DBDictionary to whatever you have in
the working environments should work for you. For medium term, you'll
probably want to write your own DBDictionary for MaxDB (start by ext



On Thu, Oct 28, 2010 at 9:27 AM, Rick Curtis <cu...@gmail.com> wrote:

> Are you sure that your application configuration is the same between the
> working and non-working installation? You are using the DB2Dictionary[1],
> and we are trying to validate that your DB is a supported version(which
> it's
> not).
>
> Can you post the contents of your persistence.xml file?
>
> [1] org.apache.openjpa.jdbc.sql.DB2Dictionary
>
> Thanks,
> Rick
>
> On Thu, Oct 28, 2010 at 8:58 AM, joe <fi...@yahoo.de> wrote:
>
> > Hi,
> >
> > i use OpenJPA(1.2.1) with OpenEJB(3.1.2).
> > I know OpenJPA does not support automatic table creation from entities
> for
> > SAP MaxDB. So i create the tables manually before using JPA.
> > Using JPA for reading/manipulating table content works here perfectly
> even
> > for SAP MaxDB many times.
> > But yesterday i had one installation where it doesn't work.
> > When calling an EJB this installation produces the stack trace at the end
> > of this email.
> >
> > Why does the EJB call works normally but not this time?
> > For another installation, same versions of OpenJPA, OpenEJB, and SAP
> MaxDB,
> > everything works fine.
> >
> >
> > The database product "SAP DB", version "KERNEL    7.6.03   BUILD
> > 015-123-173-107" is not officially supported.
> >                at
> >
> org.apache.openjpa.jdbc.sql.DB2Dictionary.connectedConfiguration(DB2Dictionary.java:278)
> >                at
> >
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:158)
> >                at
> >
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:99)
> >                at
> >
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:562)
> >                at
> >
> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1265)
> >                at
> >
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
> >                at
> >
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
> >                at
> > org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
> >                at
> >
> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
> >                at
> > org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
> >                at
> >
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:863)
> >                at
> >
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:854)
> >                at
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
> >                at
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
> >                at
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
> >                at
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
> >                at
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
> >                at
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:105)
> >                at
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:61)
> >                at
> >
> org.apache.openejb.persistence.JtaEntityManager.createQuery(JtaEntityManager.java:173)
> > ...
> >
>

Re: SAP MaxDB not supported?

Posted by Rick Curtis <cu...@gmail.com>.
Are you sure that your application configuration is the same between the
working and non-working installation? You are using the DB2Dictionary[1],
and we are trying to validate that your DB is a supported version(which it's
not).

Can you post the contents of your persistence.xml file?

[1] org.apache.openjpa.jdbc.sql.DB2Dictionary

Thanks,
Rick

On Thu, Oct 28, 2010 at 8:58 AM, joe <fi...@yahoo.de> wrote:

> Hi,
>
> i use OpenJPA(1.2.1) with OpenEJB(3.1.2).
> I know OpenJPA does not support automatic table creation from entities for
> SAP MaxDB. So i create the tables manually before using JPA.
> Using JPA for reading/manipulating table content works here perfectly even
> for SAP MaxDB many times.
> But yesterday i had one installation where it doesn't work.
> When calling an EJB this installation produces the stack trace at the end
> of this email.
>
> Why does the EJB call works normally but not this time?
> For another installation, same versions of OpenJPA, OpenEJB, and SAP MaxDB,
> everything works fine.
>
>
> The database product "SAP DB", version "KERNEL    7.6.03   BUILD
> 015-123-173-107" is not officially supported.
>                at
> org.apache.openjpa.jdbc.sql.DB2Dictionary.connectedConfiguration(DB2Dictionary.java:278)
>                at
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:158)
>                at
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:99)
>                at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:562)
>                at
> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1265)
>                at
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
>                at
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
>                at
> org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
>                at
> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
>                at
> org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
>                at
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:863)
>                at
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:854)
>                at
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
>                at
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
>                at
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
>                at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
>                at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
>                at
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:105)
>                at
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:61)
>                at
> org.apache.openejb.persistence.JtaEntityManager.createQuery(JtaEntityManager.java:173)
> ...
>