-->
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.  [ 4 posts ] 
Author Message
 Post subject: Dialect Problems
PostPosted: Fri Nov 21, 2003 6:02 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Hi all,

I'm a new user of Hibernate so I tried to use a simple application bur I have a probem wih the Dialect. I use an Oracle 9i Database and when I run the programm I have this error :

run:
[java] 21 nov. 2003 09:50:47 net.sf.hibernate.cfg.Environment <clinit>
[java] INFO: Hibernate 2.0.3
[java] 21 nov. 2003 09:50:47 net.sf.hibernate.cfg.Environment <clinit>
[java] INFO: loaded properties from resource hibernate.properties: {hiberna
te.connection.username=hybernate, hibernate.connection.password=hybernate, hiber
nate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dia
lect.Oracle9Dialect, hibernate.connection.url=jdbc:oracle:thin:@MCS-SRV-LD-01:15
21:MCSDBDEV, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver}
[java] 21 nov. 2003 09:50:47 net.sf.hibernate.cfg.Environment <clinit>
[java] INFO: using CGLIB reflection optimizer
[java] 21 nov. 2003 09:50:47 net.sf.hibernate.cfg.Environment <clinit>
[java] INFO: JVM proxy support: true
[java] 21 nov. 2003 09:50:47 net.sf.hibernate.cfg.Configuration addClass
[java] INFO: Mapping resource: dbdemo/Keyword.hbm.xml
[java] 21 nov. 2003 09:50:48 net.sf.hibernate.cfg.Binder bindRootClass
[java] INFO: Mapping class: dbdemo.Keyword -> keywords
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.cfg.Configuration secondPassC
ompile
[java] INFO: processing one-to-many association mappings
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.cfg.Configuration secondPassC
ompile
[java] INFO: processing foreign key constraints
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.impl.SessionFactoryImpl <init
>
[java] INFO: building session factory
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.dialect.Dialect <init>
[java] INFO: Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.connection.DriverManagerConne
ctionProvider configure
[java] INFO: Hibernate connection pool size: 20
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.connection.DriverManagerConne
ctionProvider configure
[java] INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:ora
cle:thin:@MCS-SRV-LD-01:1521:MCSDBDEV
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.connection.DriverManagerConne
ctionProvider configure
[java] INFO: connection properties: {user=hybernate, password=hybernate}
[java] 21 nov. 2003 09:50:49 net.sf.hibernate.impl.SessionFactoryImpl <init
>
[java] INFO: Use outer join fetching: true
[java] 21 nov. 2003 09:50:51 net.sf.hibernate.impl.SessionFactoryImpl <init
>
[java] INFO: Use scrollable result sets: true
[java] 21 nov. 2003 09:50:51 net.sf.hibernate.impl.SessionFactoryImpl <init
>
[java] INFO: JDBC 2 max batch size: 15
[java] net.sf.hibernate.MappingException: Dialect does not support native k
ey generation
[java] at net.sf.hibernate.dialect.Dialect.getIdentitySelectString(Dial
ect.java:267)
[java] at net.sf.hibernate.persister.AbstractEntityPersister.<init>(Abs
tractEntityPersister.java:499)
[java] at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersi
ster.java:665)
[java] at net.sf.hibernate.persister.PersisterFactory.create(PersisterF
actory.java:29)
[java] at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactor
yImpl.java:207)
[java] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Config
uration.java:627)



If someone can help me.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 6:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Looks like you have <generator class="identity"/> somewhere, which is not supported in Oracle.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 6:10 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Ok but where I can find the problem?
My configuration is :

hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username hybernate
hibernate.connection.password hybernate
hibernate.connection.url jdbc:oracle:thin:@MCS-SRV-LD-01:1521:MCSDBDEV

In the jar hibernate2.jar I have find the good class but aulways the same problem.

Thanks


Top
 Profile  
 
 Post subject: Solve
PostPosted: Fri Nov 21, 2003 6:16 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Ok Thanks a lot, I have find the problem :
the
<generator class="native"/> must be native and not identity


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