Re: Tomcat, Hibernate, Oracle: Dialect does not support native key generation
From: Martin (mbierwirth_at_gmx.de)
Date: 05/11/04
- Next message: Paul Schmidt: "Reporting Tools"
- Previous message: James Greenfield: "Re: Matching NULL column entries"
- In reply to: Emmanuel: "Re: Tomcat, Hibernate, Oracle: Dialect does not support native key generation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 May 2004 00:48:13 -0700
Emmanuel <user@domain.invalid> wrote in message news:<409e8cce$0$8642$626a14ce@news.free.fr>...
> Martin wrote:
> > Finally, I'm not getting this MappingException anymore. After two days
> > of reading and trying I got Hibernate to work.
> >
> > For solving the problem I modified so much (updated to Hibernate 2.1,
> > changed JDBC-driver, tried different configs) that I can only assume
> > what the cause was:
> >
> > In the hibernate-mapping-configuration of a class Foo (given in the
> > file Foo.hbm.xml) there's an entry
> >
> > <id name="id" column="id" type="java.lang.Integer" unsaved-value="0">
> > <generator class="identity"/>
> > </id>
> >
> > for defining a primary-key of the entity Foo. In my project this
> > throws a MappingException "Dialect does not support identity key
> > generation". But when I use <generator class="native"/> instead,
> > there's no more problem. So I guess there has been some
> > incompatibility with old JDBC-driver and/or old Hibernate 2.0.3.
> >
> > So glad this is over...
> >
> > Martin
> hibernate 2.0.3and Oracle 9 works perfectly.
> Use Oracle9Dialect.
> Don't use identity, Oracle does not support identity, it supports sequence.
> native choose between identity and support.
Thanks, Emmanuel.
When I had this problem I didn't know what 'native key generation' was
or what this 'identity' was for. I haven't really been experienced in
SQL, have only used JDBC with simple tables in MySQL before - probably
that was the major problem.
Still my impression about using Hibernate is that the additional tier
for O/R-mapping makes it very hard to debug, i.e. trace errors to the
root. As a Java-programmer I'm used to getting meaningful
error-messages of the compiler or the VM that tell me quite precisely
where an error ocurred.
I guess the more convenience you add to 'plain' JSP, Servlets and JDBC
on the code-writing's side, the harder it is to test and debug.
Martin
- Next message: Paul Schmidt: "Reporting Tools"
- Previous message: James Greenfield: "Re: Matching NULL column entries"
- In reply to: Emmanuel: "Re: Tomcat, Hibernate, Oracle: Dialect does not support native key generation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|