1

I am trying to use hibernate with a TimesTen database.

I have the correct dialect: TimesTenDialect1122.java but I am unsure of how to add this to my project within Eclipse.

The package in the file is declared as:

package org.hibernate.dialect;

So how do I add it to my project correctly.

I currently have it in my resources folder and within my hibernate config flie I have

<property name="hibernate.dialect" >
org.hibernate.dialect.TimesTenDialect1122 
</property>

But this obviously does not work as it can't find the class.

Stack trace and error:

INFO: JDBC isolation level: READ_COMMITTED
Dec 17, 2014 10:38:41 AM org.hibernate.connection.DriverManagerConnectionProvider     configure
INFO: using driver: com.timesten.jdbc.TimesTenDriver at URL:   jdbc:timesten:client:dsn=DEV TT
Dec 17, 2014 10:38:41 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=USER, password=PASSWORD}
Dec 17, 2014 10:38:41 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: TimesTen, version: 11.02.02.0007 Oracle TimesTen IMDB version 11.2.2.7.8
Dec 17, 2014 10:38:41 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: JDBC-ODBC Bridge (ttclient1122.dll), version: 11.2.2.7.4   (11.02.0002.0007)
Exception in thread "main" org.hibernate.HibernateException: Dialect class not found:     org.hibernate.dialect.TimesTenDialect1122
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:81)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:42)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
at com.fil.foras.ActAsPOC.ActAsPOC.main(ActAsPOC.java:17)
Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
Simon Nicholls
  • 635
  • 1
  • 9
  • 31

1 Answers1

1

According to Oracle TimesTen documentation:

Note that this configuration uses the included Hibernate dialect called TimesTenDialect1122. This dialect is not included in current versions of the Hibernate distribution. The TimesTenDialect1122 class is compiled and packaged into this application. This is the recommended Hibernate dialect for TimesTen 11.2.2 applications.

So you probably didn't include the jar containing the dialect into your project class-path:

Make sure property timesten.jdbc.driver.jar and the home.dir of the ORM installation are set correctly in file build.properties

Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
  • I already have the JDBC driver in my project but I've found a readme that says you need to build the dialect class with ant which will solve all my needs - this pointed me in the right direction though thank you! – Simon Nicholls Dec 17 '14 at 11:28