-->
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.  [ 9 posts ] 
Author Message
 Post subject: Dialect does not support sequences ????
PostPosted: Fri Oct 21, 2005 10:41 am 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Hi,

I'm trying to use a sequence generator with Oracle 9i and Hibernate 2.1.8, but I get a "net.sf.hibernate.MappingException: Dialect does not support sequences" error when Hb reads my config file. Doesn't support sequences??? The docs specifically state that sequences are supported for Oracle, among others. What am I doing wrong? Here are the particulars:

hb config
-------------------
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="show_sql">true</property>
<property name="c3p0.min_size">20</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.timeout">300</property>
<property name="c3p0.max_statements">50</property>
<property name="c3p0.idle_test_period">3000</property>
<property name="jdbc.use_streams_for_binary">true</property>
<property name="myeclipse.connection.profile">Oracle</property>
<property name="connection.url">
jdbc:oracle:thin:@server:1521:whdev
</property>
<property name="connection.username">zzz</property>
<property name="connection.password">zzz</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<mapping resource="gov/mass/eos/common/options/Risks.hbm.xml" />
</session-factory>
</hibernate-configuration>

------- xdoclet for id

/**
* @hibernate.id column="sa_codes_id" type="java.lang.Long" generator-class="sequence" unsaved-value="null
* @hibernate.generator-param name="sequence" value="risk_seq"
*/
public Long getId() {
return id;
}

-------- mapping file

<id
name="id"
column="sa_codes_id"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="sequence">
<param name="sequence">risk_seq</param>
</generator>
</id>

--------- stack trace

%%%% Error Creating SessionFactory %%%%
net.sf.hibernate.MappingException: could not instantiate id generator
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82)
at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:82)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:645)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:692)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:796)
at gov.mass.eos.common.persistence.factory.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:51)
at gov.mass.eos.common.persistence.HibernatePersistenceManager.getSession(HibernatePersistenceManager.java:241)
at gov.mass.eos.common.persistence.HibernatePersistenceManager.<init>(HibernatePersistenceManager.java:64)
at gov.mass.eos.common.persistence.factory.PersistenceManagerFactory.createPersistenceManager(PersistenceManagerFactory.java:74)
at gov.mass.eos.common.cache.CacheDao.getReferenceData(CacheDao.java:40)
at gov.mass.eos.common.xml.ConfigurationManager.getCacheBag(ConfigurationManager.java:114)
at gov.mass.eos.common.cache.ejb.CacheService.createCache(CacheService.java:146)
at gov.mass.eos.common.cache.ejb.CacheService_7345zk_EOImpl.createCache(CacheService_7345zk_EOImpl.java:302)
at gov.mass.eos.servlet.init.CacheInitContextListener.contextInitialized(CacheInitContextListener.java:62)
at weblogic.servlet.internal.WebAppServletContext$FireContextListenerAction.run(WebAppServletContext.java:7044)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.notifyCreated(WebAppServletContext.java:1753)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3352)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:6208)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:864)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2134)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2175)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2122)
at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3099)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1768)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:351)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
at weblogic.Server.main(Server.java:32)
Caused by: net.sf.hibernate.MappingException: Dialect does not support sequences
at net.sf.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:327)
at net.sf.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:57)
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:78)
... 33 more
<Oct 21, 2005 10:16:55


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 10:49 am 
Beginner
Beginner

Joined: Tue Nov 25, 2003 3:33 pm
Posts: 35
should not the property

<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
be
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>


Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
why are you mixing hibernate 2 and hibernate 3 configuration and code ?


btw: dialect is an ok property name, we append "hibernate." automatically when we read the file

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:04 am 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Thanks Alex, I tried that but it didn't make any difference....

Don

ashneyde wrote:
should not the property

<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
be
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>


Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:07 am 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
We started out with Hibernate 3, but because of the Antlr and Weblogic issue, we went back to Hb 2. What parts of the mapping file are Hb 3? My XML verifies ok with the DTD...

Don

max wrote:
why are you mixing hibernate 2 and hibernate 3 configuration and code ?


btw: dialect is an ok property name, we append "hibernate." automatically when we read the file


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:09 am 
Beginner
Beginner

Joined: Tue Nov 25, 2003 3:33 pm
Posts: 35
[quote="dononelson"]We started out with Hibernate 3, but because of the Antlr and Weblogic issue, we went back to Hb 2. What parts of the mapping file are Hb 3? My XML verifies ok with the DTD...

Don

[quote="max"]why are you mixing hibernate 2 and hibernate 3 configuration and code ?


btw: dialect is an ok property name, we append "hibernate." automatically when we read the file[/quote][/quote]

the dialect starts with org.hibernate so it is Hibernate 3 while the rest of your trace says net.sf


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

regarding weblogic - did it not work with putting antlrH3.jar into its classpath ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 8:29 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Max, (and also to ashneyde)

Thanks for the pointers - changing the dialect to the proper Dialect classpath did the trick.

WRT WebLogic, we are deploying this for a state program in which we have absolutely no control over the environment, so classpaths, etc. are out of our control.

Thanks for the help everyone!!!

Don

max wrote:
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

regarding weblogic - did it not work with putting antlrH3.jar into its classpath ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 22, 2005 2:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no possibility to even fix bugs in the underlying app server ? :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.