maybe this is a stupid question, but I do want to have things completely clear:
I have been using MySQL with autoincrement. This does work when doing inserts. The
autoincrement field is automatically incremented when inserting a field.
I want to do the same for Oracle, but Oracle does not support autoincrement fields. I
have found a triggering mechanism (outside of Turbine and has to be inserted manually
or added via the templates) that can be used for autoincrement fields in combination
with the Sequence, but this fails when using it from the peer objects. Oracle
complains about the unique primary key being null, which is not allowed. It looks like
Oracle executes the trigger a little too late ;-( This is when using the autoincrement
keyword in the table definition.
Reading the message below sounds like that Oracle can be used with Sequence and
without the special trigger by only using the sequence keyword in the table
definition? Do the peer objects work this out then? Which version of Turbine/Torque do
I need to get this functionality? The version from CVS like John mentioned?
Could you please clarify?
Many thanks in advance,
Frank
----- Original Message -----
From: Turpin, Jay
To: '[EMAIL PROTECTED]'
Sent: Sunday, May 13, 2001 01:00
Subject: RE: Oracle, autoincrment and idtable
I don't know if this might solve your problem with using Oracle sequence,
but to get autoincrement to work properly, we had to modify the following
class:
org.apache.turbine.util.db.map.TurbineMapBuilder
It has hard-coded all of the table maps use for the Turbine Security layer
and specified that each table should use IDBROKER. Once we changed it to
AUTOINCREMENT for SQL Server 2000, the security classes began working
properly with the tables we created. For Oracle, you should be able to
change it to SEQUENCE for each table.
Also, we noticed that this class overwrites the table map for TurbineUser,
even though it's defined in it's own mapbuilder class. This class should be
modified to either remove the TurbineUser table map definition, or perform a
check to only create a tablemap if it doesn't already exist.
Regards,
Jay Turpin
Intel Corporation
-----Original Message-----
From: Frank W. Nolden [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 12, 2001 2:01 PM
To: [EMAIL PROTECTED]
Subject: Re: Oracle, autoincrment and idtable
Thanks. Although I hoped this not to be true it does confirm my first
thoughts.
I will first try and use the idbroker solution (I agree it to be preferreed
since it is DB independent) and later try the Oracle sequence as it is
supported in the latest CVS turbine.
BTW I tries to use triggers inserting the autoincrement field using the
sequence. However, the peers do not like this or do not support this. Still
get the Oracle error about a unique indexed field not null allowed. Is the
Sequence support you are referring to in the CVS a fix for this behaviour?
Regards,
Frank
----- Original Message -----
From: "John McNally" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 6:22 PM
Subject: Re: Oracle, autoincrment and idtable
> you will need to add rows for the additional tables to ID_TABLE
> manually. Also the OM/Peer system can use Oracle sequences, you will
> want the latest cvs of turbine though. The IDBroker solution is
> recommended.
>
> john mcnally
>
> "Frank W. Nolden" wrote:
> >
> > I was trying to use Oracle with autoincrement table fields, but
unfortunately it does not support this. It only supports this with triggers,
but then we cannot define primary keys being not null. Is there a solution
for this?
> >
> > Now we want to use the idtable broker for use with Oracle, but I cannot
seem to generate this correctly. Where do I have to configure the use of the
idbroker using the id_table? I have done it in the XML project definition,
but the code does not seem to be generated.
> > Any ideas?
> > Regards,
> >
> > Frank
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]