You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Jacopo Cappellato <ti...@sastau.it> on 2007/06/11 18:53:39 UTC
Create index error while building OFBiz's db in Oracle
Today I got the following error while running "ant run-install-seed":
CREATE INDEX AFFILIATE_PARTY ON OFBIZSCHEMA.AFFILIATE (PARTY_ID)
Error: An index already exists for this list of columns
The db is Oracle and with trunk OFBiz.
Any ideas?
Jacopo
Re: Create index error while building OFBiz's db in Oracle
Posted by Jacopo Cappellato <ti...@sastau.it>.
And this is what I've found about the error in Oracle forums:
http://www.error-code.org.uk/view.asp?cl=ORACLE&p=ORA&ec=01408
Jacopo
Jacopo Cappellato wrote:
> And this is the complete error log:
>
> [java] 2007-06-13 11:58:37,062 (main) [ DatabaseUtil.java:2710:ERROR]
> Could not create foreign key indices for entity [Affiliate]: SQL
> Exception while executing the following:
> [java] CREATE INDEX AFFILIATE_PARTY ON DBCGCGEST.AFFILIATE (PARTY_ID)
> [java] Error was: java.sql.SQLException: ORA-01408: such column
> list already indexed
> [java]
> [java] Exception in thread "main" java.lang.NullPointerException
> [java] at
> org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAConnectionImpl.removeConnectionEventListener(XAConnectionImpl.java:225)
>
> [java] at
> org.ofbiz.minerva.pool.jdbc.xa.XAConnectionFactory$2.closeConnection(XAConnectionFactory.java:101)
>
> [java] at
> org.ofbiz.minerva.pool.jdbc.xa.XAConnectionFactory$2.connectionClosed(XAConnectionFactory.java:95)
>
> [java] at
> org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAConnectionImpl.clientConnectionClosed(XAConnectionImpl.java:155)
>
> [java] at
> org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAClientConnection.close(XAClientConnection.java:293)
>
> [java] at
> org.ofbiz.entity.jdbc.DatabaseUtil.createForeignKeyIndex(DatabaseUtil.java:2763)
>
> [java] at
> org.ofbiz.entity.jdbc.DatabaseUtil.createForeignKeyIndices(DatabaseUtil.java:2707)
>
> [java] at
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:389)
> [java] at
> org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
> [java] at
> org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1087)
> [java] at
> org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:198)
>
> [java] at
> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:184)
> [java] at
> org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:116)
>
> [java] at
> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
>
> [java] at
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
> [java] at
> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
> [java] at org.ofbiz.base.start.Start.startServer(Start.java:314)
> [java] at org.ofbiz.base.start.Start.start(Start.java:318)
> [java] at org.ofbiz.base.start.Start.main(Start.java:404)
> [java] Java Result: 1
>
> Any hints (especially from the ones that are using Oracle with OFBiz)
> would be greatly appreciated.
>
> Jacopo
>
> Jacopo Cappellato wrote:
>> This is the keys definition for the Affiliate entity:
>>
>> <prim-key field="partyId"/>
>> <relation type="one" fk-name="AFFILIATE_PARTY" rel-entity-name="Party">
>> <key-map field-name="partyId"/>
>> </relation>
>> <relation type="one" fk-name="AFFILIATE_PGRP"
>> rel-entity-name="PartyGroup">
>> <key-map field-name="partyId"/>
>> </relation>
>>
>> My guess is that OFBiz tries to create the index for the partyId field
>> three times:
>>
>> 1) because the field is the primary key
>> 2) because of the fk with the Party entity
>> 3) because of the fk with the PartyGroup entity
>>
>> Maybe (but I could be wrong) the db is throwing an error because we
>> are trying to create the same exact index (with different names) three
>> times.
>>
>> Any suggestions on how we could fix this?
>>
>> Jacopo
>>
>>
>> David E Jones wrote:
>>>
>>> Have you checked to see if this is an auto-index from a foreign key
>>> definition or a manually defined one?
>>>
>>> My guess is the first and there are just two FKs that are very
>>> similar, in which case the auto index name creation needs to be more
>>> intelligent or the FKs setup a little different.
>>>
>>> -David
>>>
>>>
>>> Jacopo Cappellato wrote:
>>>> Today I got the following error while running "ant run-install-seed":
>>>>
>>>> CREATE INDEX AFFILIATE_PARTY ON OFBIZSCHEMA.AFFILIATE (PARTY_ID)
>>>>
>>>> Error: An index already exists for this list of columns
>>>> The db is Oracle and with trunk OFBiz.
>>>>
>>>> Any ideas?
>>>>
>>>> Jacopo
>>>>
>
Re: Create index error while building OFBiz's db in Oracle
Posted by Jacopo Cappellato <ti...@sastau.it>.
And this is the complete error log:
[java] 2007-06-13 11:58:37,062 (main) [
DatabaseUtil.java:2710:ERROR]
Could not create foreign key indices for entity [Affiliate]: SQL
Exception while executing the following:
[java] CREATE INDEX AFFILIATE_PARTY ON DBCGCGEST.AFFILIATE (PARTY_ID)
[java] Error was: java.sql.SQLException: ORA-01408: such column
list already indexed
[java]
[java] Exception in thread "main" java.lang.NullPointerException
[java] at
org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAConnectionImpl.removeConnectionEventListener(XAConnectionImpl.java:225)
[java] at
org.ofbiz.minerva.pool.jdbc.xa.XAConnectionFactory$2.closeConnection(XAConnectionFactory.java:101)
[java] at
org.ofbiz.minerva.pool.jdbc.xa.XAConnectionFactory$2.connectionClosed(XAConnectionFactory.java:95)
[java] at
org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAConnectionImpl.clientConnectionClosed(XAConnectionImpl.java:155)
[java] at
org.ofbiz.minerva.pool.jdbc.xa.wrapper.XAClientConnection.close(XAClientConnection.java:293)
[java] at
org.ofbiz.entity.jdbc.DatabaseUtil.createForeignKeyIndex(DatabaseUtil.java:2763)
[java] at
org.ofbiz.entity.jdbc.DatabaseUtil.createForeignKeyIndices(DatabaseUtil.java:2707)
[java] at
org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:389)
[java] at
org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
[java] at
org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1087)
[java] at
org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:198)
[java] at
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:184)
[java] at
org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:116)
[java] at
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
[java] at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
[java] at
org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
[java] at org.ofbiz.base.start.Start.startServer(Start.java:314)
[java] at org.ofbiz.base.start.Start.start(Start.java:318)
[java] at org.ofbiz.base.start.Start.main(Start.java:404)
[java] Java Result: 1
Any hints (especially from the ones that are using Oracle with OFBiz)
would be greatly appreciated.
Jacopo
Jacopo Cappellato wrote:
> This is the keys definition for the Affiliate entity:
>
> <prim-key field="partyId"/>
> <relation type="one" fk-name="AFFILIATE_PARTY" rel-entity-name="Party">
> <key-map field-name="partyId"/>
> </relation>
> <relation type="one" fk-name="AFFILIATE_PGRP" rel-entity-name="PartyGroup">
> <key-map field-name="partyId"/>
> </relation>
>
> My guess is that OFBiz tries to create the index for the partyId field
> three times:
>
> 1) because the field is the primary key
> 2) because of the fk with the Party entity
> 3) because of the fk with the PartyGroup entity
>
> Maybe (but I could be wrong) the db is throwing an error because we are
> trying to create the same exact index (with different names) three times.
>
> Any suggestions on how we could fix this?
>
> Jacopo
>
>
> David E Jones wrote:
>>
>> Have you checked to see if this is an auto-index from a foreign key
>> definition or a manually defined one?
>>
>> My guess is the first and there are just two FKs that are very
>> similar, in which case the auto index name creation needs to be more
>> intelligent or the FKs setup a little different.
>>
>> -David
>>
>>
>> Jacopo Cappellato wrote:
>>> Today I got the following error while running "ant run-install-seed":
>>>
>>> CREATE INDEX AFFILIATE_PARTY ON OFBIZSCHEMA.AFFILIATE (PARTY_ID)
>>>
>>> Error: An index already exists for this list of columns
>>> The db is Oracle and with trunk OFBiz.
>>>
>>> Any ideas?
>>>
>>> Jacopo
>>>
Re: Create index error while building OFBiz's db in Oracle
Posted by Jacopo Cappellato <ti...@sastau.it>.
This is the keys definition for the Affiliate entity:
<prim-key field="partyId"/>
<relation type="one" fk-name="AFFILIATE_PARTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="AFFILIATE_PGRP" rel-entity-name="PartyGroup">
<key-map field-name="partyId"/>
</relation>
My guess is that OFBiz tries to create the index for the partyId field
three times:
1) because the field is the primary key
2) because of the fk with the Party entity
3) because of the fk with the PartyGroup entity
Maybe (but I could be wrong) the db is throwing an error because we are
trying to create the same exact index (with different names) three times.
Any suggestions on how we could fix this?
Jacopo
David E Jones wrote:
>
> Have you checked to see if this is an auto-index from a foreign key
> definition or a manually defined one?
>
> My guess is the first and there are just two FKs that are very similar,
> in which case the auto index name creation needs to be more intelligent
> or the FKs setup a little different.
>
> -David
>
>
> Jacopo Cappellato wrote:
>> Today I got the following error while running "ant run-install-seed":
>>
>> CREATE INDEX AFFILIATE_PARTY ON OFBIZSCHEMA.AFFILIATE (PARTY_ID)
>>
>> Error: An index already exists for this list of columns
>> The db is Oracle and with trunk OFBiz.
>>
>> Any ideas?
>>
>> Jacopo
>>
Re: Create index error while building OFBiz's db in Oracle
Posted by David E Jones <jo...@hotwaxmedia.com>.
Have you checked to see if this is an auto-index from a foreign key definition or a manually defined one?
My guess is the first and there are just two FKs that are very similar, in which case the auto index name creation needs to be more intelligent or the FKs setup a little different.
-David
Jacopo Cappellato wrote:
> Today I got the following error while running "ant run-install-seed":
>
> CREATE INDEX AFFILIATE_PARTY ON OFBIZSCHEMA.AFFILIATE (PARTY_ID)
>
> Error: An index already exists for this list of columns
> The db is Oracle and with trunk OFBiz.
>
> Any ideas?
>
> Jacopo
>