You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Frank W. Nolden" <fr...@maxware.nl> on 2001/05/11 16:27:32 UTC

Oracle, autoincrment and idtable

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


Re: Oracle, autoincrment and idtable

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Hi John,

when I tested it it seemed like the autoincrement field was not filled with data. I have a table EFI which contains a fields EFI_ID. This is an autoincrement field. 
When using the OM/Peer system it failed to insert the record due to an empty EFI_ID. Oracle rejected it, so it seems that the OM/Peers did not fill the field EFI_ID before inserting it into the Orcale table.
Am I still making sense?

I will regenerate the stuff again today (tomorrow the latest) and will try again. Keep you posted, but if you have info in between I am happy to hear it.
Regards,

Frank
  ----- Original Message ----- 
  From: John McNally 
  To: turbine-user@jakarta.apache.org 
  Sent: Tuesday, May 15, 2001 21:59
  Subject: Re: Oracle, autoincrment and idtable


  idmethod=sequence should result in exact same behavior as autoincrement
  as far as the OM/Peer objects are concerned.  What is the problem?

  john mcnally

  "Frank W. Nolden" wrote:
  > 
  > Still not completely where I wanted to be. I have found the id-table stuff.
  > As John explained below I have to create the rows manually. This is OK but
  > now we wanted to use the Sequence for our project. I have changed the xml
  > project file to indicate that I want sequence for each table where I need
  > autoincrement.
  > The tables are generated OK , the Sequence tables as well (both through the
  > SQL script). Now I want to use the peers, but they give me errors.
  > 
  > I have to get the latest sequencenumber from the sequence table and put this
  > in the autoincrement field. I have found code in Turbine doing this, like
  > SequenceIdGenerator in  etc, but it seems that I cannot use this together
  > with the peers. It even mentions in the generated MapBuilder files
  > tMap.setPrimaryKeyMethod(TableMap.SEQUENCE);, which indicates that it is
  > using Sequences.
  > Shouldn't this be integrated in the peers or am I completely off track now?
  > Any help highly appreciated.
  > 
  > Frank
  > 
  > ----- Original Message -----
  > From: John McNally
  > To: turbine-user@jakarta.apache.org
  > Sent: Friday, May 11, 2001 18:22
  > 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: turbine-user-unsubscribe@jakarta.apache.org
  > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
  > 
  > ---------------------------------------------------------------------
  > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
  > For additional commands, e-mail: turbine-user-help@jakarta.apache.org

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
  For additional commands, e-mail: turbine-user-help@jakarta.apache.org



Re: Oracle, autoincrment and idtable

Posted by John McNally <jm...@collab.net>.
idmethod=sequence should result in exact same behavior as autoincrement
as far as the OM/Peer objects are concerned.  What is the problem?

john mcnally

"Frank W. Nolden" wrote:
> 
> Still not completely where I wanted to be. I have found the id-table stuff.
> As John explained below I have to create the rows manually. This is OK but
> now we wanted to use the Sequence for our project. I have changed the xml
> project file to indicate that I want sequence for each table where I need
> autoincrement.
> The tables are generated OK , the Sequence tables as well (both through the
> SQL script). Now I want to use the peers, but they give me errors.
> 
> I have to get the latest sequencenumber from the sequence table and put this
> in the autoincrement field. I have found code in Turbine doing this, like
> SequenceIdGenerator in  etc, but it seems that I cannot use this together
> with the peers. It even mentions in the generated MapBuilder files
> tMap.setPrimaryKeyMethod(TableMap.SEQUENCE);, which indicates that it is
> using Sequences.
> Shouldn't this be integrated in the peers or am I completely off track now?
> Any help highly appreciated.
> 
> Frank
> 
> ----- Original Message -----
> From: John McNally
> To: turbine-user@jakarta.apache.org
> Sent: Friday, May 11, 2001 18:22
> 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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Oracle, autoincrment and idtable

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Still not completely where I wanted to be. I have found the id-table stuff.
As John explained below I have to create the rows manually. This is OK but
now we wanted to use the Sequence for our project. I have changed the xml
project file to indicate that I want sequence for each table where I need
autoincrement.
The tables are generated OK , the Sequence tables as well (both through the
SQL script). Now I want to use the peers, but they give me errors.

I have to get the latest sequencenumber from the sequence table and put this
in the autoincrement field. I have found code in Turbine doing this, like
SequenceIdGenerator in  etc, but it seems that I cannot use this together
with the peers. It even mentions in the generated MapBuilder files
tMap.setPrimaryKeyMethod(TableMap.SEQUENCE);, which indicates that it is
using Sequences.
Shouldn't this be integrated in the peers or am I completely off track now?
Any help highly appreciated.

Frank

----- Original Message -----
From: John McNally
To: turbine-user@jakarta.apache.org
Sent: Friday, May 11, 2001 18:22
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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Oracle, autoincrment and idtable

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
Still not completely where I wanted to be. I have found the id-table stuff.
As John explained below I have to create the rows manually. This is OK but
now we wanted to use the Sequence for our project. I have changed the xml
project file to indicate that I want sequence for each table where I need
autoincrement.
The tables are generated OK , the Sequence tables as well (both through the
SQL script). Now I want to use the peers, but they give me errors.

I have to get the latest sequencenumber from the sequence table and put this
in the autoincrement field. I have found code in Turbine doing this, like
SequenceIdGenerator in  etc, but it seems that I cannot use this together
with the peers. It even mentions in the generated MapBuilder files
tMap.setPrimaryKeyMethod(TableMap.SEQUENCE);, which indicates that it is
using Sequences.
Shouldn't this be integrated in the peers or am I completely off track now?
Any help highly appreciated.

Frank

----- Original Message -----
From: John McNally
To: turbine-user@jakarta.apache.org
Sent: Friday, May 11, 2001 18:22
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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Oracle, autoincrment and idtable

Posted by "Frank W. Nolden" <fr...@maxware.nl>.
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" <jm...@collab.net>
To: <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Oracle, autoincrment and idtable

Posted by John McNally <jm...@collab.net>.
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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org