Yesterday we encountered a problem when testing an already working version of our web application. The application works well in the development environment. When we move the application to hit the production database, it throws an exception.
The application uses Hibernate as its persistence manager. Our team has been hassled for quite some times, until one of our colleagues found out that the query produced by Hibernate was not runnable from Oracle's console. Digging further we found out that the database in production used an older version, the Oracle 8i. Oracle 8i does not support INNER JOIN syntax, therefore it rejects the query produced by Hibernate.
It came across my mind that we should change the dialect. If 8i does not support what is running on 9i, then the developer of Hibernate should have put different dialects for them. This is found out to be true. There is org.hibernate.dialect. Oracle9Dialect for Oracle 9i databases, and org.hibernate.dialect.OracleDialect for older Oracle 8i databases.
After we change it to the correct dialect, the problem somehow is still there. After browsing for a while I eventually found out that we also need to change the query translator to the older version, org.hibernate.class.ClassicQueryTranslator.
Then the application is working in the production database. Voila! It works!
No comments:
Post a Comment