This content has been marked as final.
Show 2 replies
-
1. Re: How do I set hibernate.dialect property outside of persi
robertxlongo Aug 29, 2008 8:59 AM (in response to robertxlongo)By the way, we're using JBoss 4.2.2.GA.
-
2. Re: How do I set hibernate.dialect property outside of persi
robertxlongo Aug 29, 2008 10:08 AM (in response to robertxlongo)It seems that it is not necessary to set this "hibernate.dialect" property. The correct dialect is chosen by the framework at run-time. For example, if I have a mysql-ds.xml file with the following contents:
<datasources> <local-tx-datasource> <jndi-name>MyDS</jndi-name> <connection-url>jdbc:mysql://localhost:3306/mydb</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> ... <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
... then I receive the following output in the console:[ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider [InjectedDataSourceConnectionProvider] Using provided datasource [SettingsFactory] RDBMS: MySQL, version: 5.0.51b-community-nt [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} ) [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
Note that, if you don't include the database driver in deploy/lib, JBoss will throw an exception reporting that the hibernate dialect must be set. We made this mistake and the exception lead us to believe that we had to set the "hibernate.dialect" property.