[OFBiz] Dev - Postgres 8.0 and foreign key constraints

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Dev - Postgres 8.0 and foreign key constraints

Chris Juettner
Hello all,
I've searched the User and Dev lists for help with this issue without finding
the same post.  I've switched from Derby to Postgres 8.0.  When I try and
seed the new Postgres database I'm throwing foreign key constraint violations.
 The database created fine, it's just not loading data. I've actually configured
two machines with Postgres, ofbiz run-install on Win XP seeded the Postgres
database without issue but ofbiz run-install on Windows Server 2000 throws
the following exceptions. Any ideas?  Can I turn off checking foreign keys
during data load?  Thanks.

[java] 64663 (main) [EntityDataLoadContainer.java:244:INFO ] =-=-=-=-=-=-=
Starting the data load...
[java] 64883 (main) [    EntitySaxReader.java:183:INFO ] Beginning import
from URL: file:/C:/eclipse/workspace/ofbiz/framework/security/data/SecurityData.xml
[java] 64993 (main) [    EntitySaxReader.java:221:INFO ] Transaction Timeout
set to 2 hours (7200 seconds)
[java] 67397 (main) [    EntitySaxReader.java:240:INFO ] Finished 9 values
from file:/C:/eclipse/workspace/ofbiz/framework/security/data/SecurityData.xml
[java] 67397 (main) [    EntitySaxReader.java:183:INFO ] Beginning import
from URL: file:/C:/eclipse/workspace/ofbiz/framework/common/data/CommonTypeData.xml
[java] 67427 (main) [    EntitySaxReader.java:221:INFO ] Transaction Timeout
set to 2 hours (7200 seconds)
[java] 69840 (main) [   GenericDelegator.java:600:ERROR]
[java] ---- exception report ----------------------------------------------------------

[java] Failure in create operation for entity [EnumerationType]: org.ofbiz.entity.GenericEntityException:
Exception while inserting the following entity:
[GenericEntity:EnumerationType][createdStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14
13:57:06.709(java.sql.Timestamp)]
[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)]
[lastUpdatedStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][lastUpdatedTxStamp,2005-10-14
13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
(ENUM_TYPE_ID,
PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
(ERROR: insert or update on table "enumeration_type" violates foreign key
constraint "enum_type_parent"))). Rolling back transaction.

[java] Exception: org.ofbiz.entity.GenericEntityException

[java] Message: Exception while inserting the following entity: [GenericEntity:EnumerationType][createdStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][description,Thesaurus
Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)]
[lastUpdatedStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][lastUpdatedTxStamp,2005-10-14
13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
(ENUM_TYPE_ID, PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP,
LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
VALUES (?, ?, ?, ?, ?, ?, ?, ?) (ERROR: insert or update on table "enumeration_type"
violates foreign key constraint "enum_type_parent")))

[java] ---- stack trace ---------------------------------------------------------------

[java] org.ofbiz.entity.GenericEntityException: Exception while inserting
the following entity: [GenericEntity:EnumerationType][createdStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][description,Thesaurus
Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
13:57:09.082(java.sql.Timestamp)]
[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
(ENUM_TYPE_ID, PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP,

LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?,
?, ?, ?, ?, ?)
(ERROR: insert or update on table "enumeration_type" violates foreign key
constraint "enum_type_parent")))

[java] org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:140)


 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [OFBiz] Dev - Postgres 8.0 and foreign key constraints

Si Chen-2
So you are saying it workw with Postgres 8.0 on Windows XP but not with
Postgres 8.0 on Windows 2000 Server?  You might want to ask the
postgresql lists about that one--it sounds like a postgresql/windows
problem, not an ofbiz one.

You can turn remove the foreign keys in webtools under check/update
database and turn them back on after you import the data.

Si

[hidden email] wrote:

>Hello all,
>I've searched the User and Dev lists for help with this issue without finding
>the same post.  I've switched from Derby to Postgres 8.0.  When I try and
>seed the new Postgres database I'm throwing foreign key constraint violations.
> The database created fine, it's just not loading data. I've actually configured
>two machines with Postgres, ofbiz run-install on Win XP seeded the Postgres
>database without issue but ofbiz run-install on Windows Server 2000 throws
>the following exceptions. Any ideas?  Can I turn off checking foreign keys
>during data load?  Thanks.
>
>[java] 64663 (main) [EntityDataLoadContainer.java:244:INFO ] =-=-=-=-=-=-=
>Starting the data load...
>[java] 64883 (main) [    EntitySaxReader.java:183:INFO ] Beginning import
>from URL: file:/C:/eclipse/workspace/ofbiz/framework/security/data/SecurityData.xml
>[java] 64993 (main) [    EntitySaxReader.java:221:INFO ] Transaction Timeout
>set to 2 hours (7200 seconds)
>[java] 67397 (main) [    EntitySaxReader.java:240:INFO ] Finished 9 values
>from file:/C:/eclipse/workspace/ofbiz/framework/security/data/SecurityData.xml
>[java] 67397 (main) [    EntitySaxReader.java:183:INFO ] Beginning import
>from URL: file:/C:/eclipse/workspace/ofbiz/framework/common/data/CommonTypeData.xml
>[java] 67427 (main) [    EntitySaxReader.java:221:INFO ] Transaction Timeout
>set to 2 hours (7200 seconds)
>[java] 69840 (main) [   GenericDelegator.java:600:ERROR]
>[java] ---- exception report ----------------------------------------------------------
>
>[java] Failure in create operation for entity [EnumerationType]: org.ofbiz.entity.GenericEntityException:
>Exception while inserting the following entity:
>[GenericEntity:EnumerationType][createdStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14
>13:57:06.709(java.sql.Timestamp)]
>[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)]
>[lastUpdatedStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][lastUpdatedTxStamp,2005-10-14
>13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
>[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
>(ENUM_TYPE_ID,
>PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
>(ERROR: insert or update on table "enumeration_type" violates foreign key
>constraint "enum_type_parent"))). Rolling back transaction.
>
>[java] Exception: org.ofbiz.entity.GenericEntityException
>
>[java] Message: Exception while inserting the following entity: [GenericEntity:EnumerationType][createdStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
>[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][description,Thesaurus
>Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)]
>[lastUpdatedStamp,2005-10-14 13:57:09.082(java.sql.Timestamp)][lastUpdatedTxStamp,2005-10-14
>13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
>(ENUM_TYPE_ID, PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP,
>LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
>VALUES (?, ?, ?, ?, ?, ?, ?, ?) (ERROR: insert or update on table "enumeration_type"
>violates foreign key constraint "enum_type_parent")))
>
>[java] ---- stack trace ---------------------------------------------------------------
>
>[java] org.ofbiz.entity.GenericEntityException: Exception while inserting
>the following entity: [GenericEntity:EnumerationType][createdStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)][createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)]
>[description,Thesaurus Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(while inserting: [GenericEntity:EnumerationType][createdStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[createdTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][description,Thesaurus
>Relationship Type(java.lang.String)][enumTypeId,KW_THES_REL(java.lang.String)][hasTable,N(java.lang.String)][lastUpdatedStamp,2005-10-14
>13:57:09.082(java.sql.Timestamp)]
>[lastUpdatedTxStamp,2005-10-14 13:57:06.709(java.sql.Timestamp)][parentTypeId,(java.lang.String)]
>(SQL Exception while executing the following:INSERT INTO public.ENUMERATION_TYPE
>(ENUM_TYPE_ID, PARENT_TYPE_ID, HAS_TABLE, DESCRIPTION, LAST_UPDATED_STAMP,
>
>LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?,
>?, ?, ?, ?, ?)
>(ERROR: insert or update on table "enumeration_type" violates foreign key
>constraint "enum_type_parent")))
>
>[java] org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:140)
>
>
>
>_______________________________________________
>Dev mailing list
>[hidden email]
>http://lists.ofbiz.org/mailman/listinfo/dev
>
>  
>
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev