These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Odd Switch from org.hibernate.dialect.Oracle to net.sf. ...
PostPosted: Sat Aug 26, 2006 7:14 pm 
Newbie

Joined: Sun Jan 22, 2006 3:25 pm
Posts: 6
I'm using Hibernate 3.1 with both Oracle 10G and MySql. The app server is WebSphere 6 under RAD 6.

MySql works fine.

But Oracle mysteriously switches from org.hibernate.dialect.OracleDialect to net.sf.hibernate.dialect.Oracle9Dialect. A file search shows that the string "net.sf.hibernate.dialect.Oracle9Dialect" occurs nowhere in any of my ascii files.

Here is the relevant stack trace portion:

[8/26/06 14:23:20:729 GMT-05:00] 00000017 SystemErr R org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.Oracle9Dialect
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:378)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1869)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1162)
at testhibernate.MyAppContextListener.contextInitialized(MyAppContextListener.java:31)

Here is the relevant hibernate configuration file - hibernate_oracle.cfg.xml:

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory
name="java:hibernate/OracleSessionFactory">
<property name="connection.datasource">jdbc/MyOracleDataSource</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>

<mapping resource="testhibernate/Employee.hbm.xml"/>

</session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 27, 2006 3:46 am 
Newbie

Joined: Sun Aug 27, 2006 3:31 am
Posts: 2
I had the same problem and found in order to fix it I did not need to include ehcache in my project/classpath. Make sure you include the jar files the docs say to.
For me to fix it I wrote a log4j.properties file as follows:
Code:
log4j.rootCategory=Info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p $c{1}:%L - %m%n
log4j.logger.net.sf.hibernate=info
log4j.logger.net.sf.hibernate.type=info

and included the following in my Oracle config file:
Code:
         <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

If any of the above doesnt work for then do some reading in doc files cos thats where I found all this stuff . Good luck.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 27, 2006 3:49 am 
Newbie

Joined: Sun Aug 27, 2006 3:31 am
Posts: 2
Oops Sorry I replied to the wrong post. Im crawling back into my hole.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.