Re: Tomcat, Hibernate, Oracle: Dialect does not support native key generation

From: Martin (mbierwirth_at_gmx.de)
Date: 05/11/04


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



Relevant Pages

  • Re: Gone quiet again
    ... has the snow made you all hibernate. ... Martin P ... hiding in the office with the heater on - far too cold to ...
    (uk.rec.engines.stationary)
  • Re: Gone quiet again
    ... has the snow made you all hibernate. ... Martin P ... 'Most' of us are keeping our heads down getting stuff ready for the new ...
    (uk.rec.engines.stationary)
  • Re: Topic: .NET/COM Interop in VB6 MSProject Addin
    ... "Martin Boehm" wrote: ... Select Debug from configuration settings ... >> tried to deploy on several test machines. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Device Emulator problems vith VS 2005 B2
    ... I am able to debug fine on VS 2005 which runs on the same machine as VS ... the emulator but not debug, the problem is that the emulator can't get a ... "Martin Massé" wrote in message ... > I have the exact same problem. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution
    ... Ok Martin we can pick this up on the morrow. ... I will add a few debug extra debug stuff about the Makefile and get you email me the results directly. ... I don't understand your response since the problem I am seeing is that sqlplus will NOT run if ORACLE_HOME is defined and it does not seem related to combining libraries into one. ...
    (perl.dbi.users)