db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@gmx.de
Subject RE: obtaining native primary keys problem
Date Fri, 28 Feb 2003 11:22:19 GMT
Hi

I'm working on the same problem at the moment. I've had a closer look at
code of torque and village and as far as I can see it's not possible to use
'native' pk generation right now.

The Torque code only provides AutoIncrementIdGenerator and
SequenceIDGenerator. Therefore as soon as you use 'native' mode there's no IDGenerator
available and the implementation will fail with an 'IDGenerator is NULL'
TorqueException.

I've just removed the check for the IDGenerator and insertion now works (at
least if you do NOT need the assigned primary key the database provides). But
I think that's exactly what you want. I'm currently working on this. Looks
like the village code has not foreseen this situation.

Probably a workaround would be using Sequences generated by your oracle
database. As I'm using db2 and the db2adapter implementation uses ID_METHOD.NONE
this will not work for me without any modifications.

The fascinating thing is: this bug has been tracked on 09/29/2002 and is
status is still 'new' !


Cheerz

Alex



> The packey is automagically created using torques "native" primary key
> selection.
> 
> Glen
> 
> 
> 
> -----Original Message-----
> From: Richard Grossman [mailto:richard@goldmail.net.il] 
> Sent: Thursday, 27 February 2003 7:05 PM
> To: Turbine Torque Users List
> Subject: Re: obtaining native primary keys problem 
> 
> 
> How do you made the insert ??
> How this key is generated do you use sequence object ?
> 
> Richard
> ----- Original Message -----
> From: "Trudgett, Glen" <Glen.Trudgett@det.nsw.edu.au>
> To: "'Turbine Torque Users List'" <torque-user@db.apache.org>
> Sent: Thursday, February 27, 2003 02:24
> Subject: RE: obtaining native primary keys problem
> 
> 
> > To All,
> >
> >
> > I currently have an Oracle DB that I am using for my data.
> >
> > I have set my tables to have natively generated primary keys, which 
> > works fine.
> >
> > I do an insert of information into a table, and the table happily 
> > accepts the data, as expected.
> >
> > test.insert("blah");
> >
> > Table
> > 1, blah
> >
> > When I try to obtain the primary key for this new entry, which I want 
> > to
> use
> > to populate a foreign key link table, using
> >
> > Test.getPrimaryKey();
> >
> > I receive a value of 0. (Not the value of 1 or whatever number it is
> > allocated!!)
> >
> > I can not work out why I can not get these values. I have tried a 
> > number
> of

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte l├Ącheln! Fotogalerie online mit GMX ohne eigene Homepage!


Mime
View raw message