db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: Dependent and element-dependent
Date Mon, 30 Jan 2006 15:26:03 GMT
Hi Michelle,

the attached patch is meant as a suggestion for named FKs in the schema. 
It changes schema1 and schema4 for datastore identity both. The idea is 
to replace all REFERENCES clauses in column definitions by CONSTRAINT 
clauses. Furthermore, it also replaces UNIQUE clauses in column 
definitions by CONSTRAINT clauses.

Regards,
Michael

Craig L Russell wrote:
> FYI, at the Friday JDO TCK conference call, Michelle volunteered to  
> update the schema with user-decipherable foreign key names.
> 
> Craig
> 
> On Jan 27, 2006, at 8:56 AM, Michael Watzek wrote:
> 
>> Hi Andy,
>>
>>
>>>> Do you have some info regarding what this FK is ?
>>>> Sadly I've no idea what Derby's nice message
>>>> "constraint 'SQL060127010242262' for key (3)"
>>>> means. It might have been nice for it to provide a column name ?  or 
>>>> a related table ? but no we get the result of '"SQL" + random ()' 
>>>> perhaps
>>>>
>>> It seems that the FK name is generated by Derby. I checked the FK  
>>> definitions in schema 1: There are several unnamed FKs in the  schema 
>>> referencing table 'persons' which may be candidates for the  message 
>>> above:
>>> - persons.manager
>>> - persons.mentor
>>> - persons.hradvisor
>>> - insuranceplans.employee
>>> - employee_phoneno_type.empid
>>
>> I renamed the FKs above in my local schema. It appears that the  
>> problem occurs on the manager column. Please see below.
>>
>> Regards,
>> Michael
>>
>>     [java] ERROR 23503: DELETE on table 'PERSONS' caused a  violation 
>> of foreign key constraint 'EMPS_MANAGER' for key (3
>> ).  The statement has been rolled back.
>>     [java]      at  
>> org.apache.derby.iapi.error.StandardException.newException(Unknown  
>> Source)
>>     [java]      at  
>> org.apache.derby.impl.sql.execute.ReferencedKeyRIChecker.doCheck 
>> (Unknown Source)
>>     [java]      at  
>> org.apache.derby.impl.sql.execute.RISetChecker.doPKCheck(Unknown  Source)
>>     [java]      at  
>> org.apache.derby.impl.sql.execute.DeleteResultSet.collectAffectedRows( 
>> Unknown Source)
>>     [java]      at  
>> org.apache.derby.impl.sql.execute.DeleteResultSet.open(Unknown Source)
>>     [java]      at  
>> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown  
>> Source)
>>     [java]      at  
>> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown  
>> Source)
>>     [java]      at  
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement 
>> (Unknown Source)
>>     [java]      at  
>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown  
>> Source)
>>     [java]      at  
>> com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute 
>> (NewProxyPreparedStatement.java:911)
>>     [java]      at  
>> org.jpox.store.rdbms.request.Request.executeUpdate(Request.java:69)
>>     [java]      at  org.jpox.store.rdbms.request.DeleteRequest.execute 
>> (DeleteRequest.java:239)
>>     [java]      at org.jpox.store.rdbms.table.ClassTable.delete 
>> (ClassTable.java:2170)
>>     [java]      at org.jpox.store.rdbms.table.ClassTable.delete 
>> (ClassTable.java:2175)
>>     [java]      at org.jpox.store.rdbms.table.ClassTable.delete 
>> (ClassTable.java:2175)
>>     [java]      at org.jpox.store.StoreManager.delete 
>> (StoreManager.java:794)
>>     [java]      at  
>> org.jpox.state.StateManagerImpl.internalDeletePersistent 
>> (StateManagerImpl.java:4010)
>>     [java]      at org.jpox.state.StateManagerImpl.deletePersistent 
>> (StateManagerImpl.java:3966)
>>     [java]      at  
>> org.jpox.AbstractPersistenceManager.internalDeletePersistent 
>> (AbstractPersistenceManager.java:1342)
>>     [java]      at  
>> org.jpox.AbstractPersistenceManager.deletePersistentAll 
>> (AbstractPersistenceManager.java:1380)
>>     [java]      at org.apache.jdo.tck.JDO_Test.deleteTearDownClasses 
>> (JDO_Test.java:396)
>>     [java]      at org.apache.jdo.tck.JDO_Test.localTearDown 
>> (JDO_Test.java:318)
>>     [java]      at org.apache.jdo.tck.JDO_Test.tearDown 
>> (JDO_Test.java:287)
>>     [java]      at org.apache.jdo.tck.JDO_Test.runBare 
>> (JDO_Test.java:234)
>>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.start 
>> (BatchTestRunner.java:120)
>>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.main 
>> (BatchTestRunner.java:95)
>>
>> -- 
>> -------------------------------------------------------------------
>> Michael Watzek                  Tech@Spree Engineering GmbH
>> mailto:mwa.tech@spree.de        Buelowstr. 66
>> Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
>> Fax.:  ++49/30/217 520 12       http://www.spree.de/
>> -------------------------------------------------------------------
> 
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message