You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Weaver, Scott" <Sw...@rippe.com> on 2001/11/12 15:41:48 UTC

Initialization ID_TABLE for project-schema and turbine-schema cau sing key conflict

Has anyone ever encountered this?  I have a project with 27 individual
tables.  When I run ant init, the ID_TABLE is initialized first with the
Turbine tables then with the project specific tables.  The problem when the
Turbine tables are inserted into the ID_TABLE they start at 11.

example from turbine-schema-idtable-init.sql:

insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(11, 'TURBINE_PERMISSION', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(12, 'TURBINE_ROLE', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(13, 'TURBINE_GROUP', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(14, 'TURBINE_ROLE_PERMISSION', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(15, 'TURBINE_USER', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(16, 'TURBINE_USER_GROUP_ROLE', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(17, 'TURBINE_SCHEDULED_JOB', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(18, 'ID_TABLE', 100, 10);

Then the project is inserted starting at 1

example from project-schema-idtable-init.sql:
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (1,
'STORE', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2,
'BUYER', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (3,
'CUSTOMER', 100, 10);
...
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(26, 'PRODUCT_RESOURCE', 100, 10);
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(27, 'RDF', 100, 10);

The problem occurs when I get to the 11th table through the 18th.  Duplicate
key errors are thrown because Turbine has already placed table entires at
these primary keys.  I looked at the idtable.<database> templates and they
all do basically the same thing:

#foreach ($tbl in $tables)
insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
($initialID, '$tbl.Name', 100, 10);
#set ( $initialID = $initialID + 1 )
#end

But for some reason $initialID is not set correctly when creating the
Turbine tables.  Any thoughts on what would cause this?

Thanks,
Scott

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Initialization ID_TABLE for project-schema and turbine-schema causing key conflict

Posted by Efren Diaz <ed...@valhallaproject.com>.
Hi Scott, i think that your problem is in the XML of your schema,  you have
to set the idMethod="idbroker"  on all of yout tables defininitons and then
run the ant init comand, this should rebuild the OM classes.

----- Original Message -----
From: "Weaver, Scott" <Sw...@rippe.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Monday, November 12, 2001 10:41 AM
Subject: Initialization ID_TABLE for project-schema and turbine-schema
causing key conflict


> Has anyone ever encountered this?  I have a project with 27 individual
> tables.  When I run ant init, the ID_TABLE is initialized first with the
> Turbine tables then with the project specific tables.  The problem when
the
> Turbine tables are inserted into the ID_TABLE they start at 11.
>
> example from turbine-schema-idtable-init.sql:
>
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (11, 'TURBINE_PERMISSION', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (12, 'TURBINE_ROLE', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (13, 'TURBINE_GROUP', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (14, 'TURBINE_ROLE_PERMISSION', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (15, 'TURBINE_USER', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (16, 'TURBINE_USER_GROUP_ROLE', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (17, 'TURBINE_SCHEDULED_JOB', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (18, 'ID_TABLE', 100, 10);
>
> Then the project is inserted starting at 1
>
> example from project-schema-idtable-init.sql:
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(1,
> 'STORE', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(2,
> 'BUYER', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
(3,
> 'CUSTOMER', 100, 10);
> ...
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (26, 'PRODUCT_RESOURCE', 100, 10);
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> (27, 'RDF', 100, 10);
>
> The problem occurs when I get to the 11th table through the 18th.
Duplicate
> key errors are thrown because Turbine has already placed table entires at
> these primary keys.  I looked at the idtable.<database> templates and they
> all do basically the same thing:
>
> #foreach ($tbl in $tables)
> insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
> ($initialID, '$tbl.Name', 100, 10);
> #set ( $initialID = $initialID + 1 )
> #end
>
> But for some reason $initialID is not set correctly when creating the
> Turbine tables.  Any thoughts on what would cause this?
>
> Thanks,
> Scott
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>