[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Can you omit hibernate.dialect in persistence.xml?

dweil do-not-reply at jboss.com
Mon Sep 29 06:55:26 EDT 2008


We want to configure the persistence layer of our application for different databases, i.e. the same application ear file should be able to be run on a JBoss with MySQL as database and on another with DB2.

Of course the JNDI name of the datasources are the same ;-)

The problem now is that the hibernate dialect has to be specified in persistence.xml, e.g.
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
or
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>

In order to make the application as portable as possible, it would be necessary to omit this property from persistence.xml. Is that possible? Can Hibernate figure out the db dialect by itself? Or can the dialect be specified somewhere in the server configuration?

Thanks in advance!
Dirk

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179318#4179318

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179318



More information about the jboss-user mailing list