Empty Standard Table deletion problem

User 677b9c22ff

12-10-2007 22:30:08

Hi,


I had an empty JChembase table and created a new Standard Table in the


Schema Editor, I tried to delete the Standard table and got the following error.


Tobias





Instant JChem Version: 2.1 (build: 071002) JChem Version: 3.2.11 Marvin Version: 4.1.13 (build date: 2007-9-20) Java: 1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03 System: Windows XP version 5.1 running on x86; Cp1252; en_US (instantjchem)





org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [DROP TABLE NEW_STANDARD_TABLE]; SQL state [X0Y25]; error code [20000]; Operation 'DROP CONSTRAINT' cannot be performed on object 'SQL071012030114520' because CONSTRAINT 'SQL071012030114770' is dependent on that object.; nested exception is java.sql.SQLException: Operation 'DROP CONSTRAINT' cannot be performed on object 'SQL071012030114520' because CONSTRAINT 'SQL071012030114770' is dependent on that object.


Caused by: ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'SQL071012030114520' because CONSTRAINT 'SQL071012030114770' is dependent on that object.


at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)


at org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.prepareToInvalidate(Unknown Source)


at org.apache.derby.impl.sql.depend.BasicDependencyManager.coreInvalidateFor(Unknown Source)


at org.apache.derby.impl.sql.depend.BasicDependencyManager.invalidateFor(Unknown Source)


at org.apache.derby.impl.sql.execute.DropTableConstantAction.dropAllConstraintDescriptors(Unknown Source)


at org.apache.derby.impl.sql.execute.DropTableConstantAction.executeConstantAction(Unknown Source)


at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)


at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)


at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)


at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)


at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)


at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)


at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)


at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:368)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:342)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:375)


at com.im.df.impl.db.dao.DFDaoSupport.dropTable(DFDaoSupport.java:204)


at com.im.df.impl.db.dao.PKAfterInsertDao.dropDatabaseArtifacts(PKAfterInsertDao.java:92)


at com.im.df.impl.db.DBSchemaManager.dropEntityArtifacts(DBSchemaManager.java:705)


at com.im.df.impl.db.persist.DBSchemaPersistenceImpl$ClientSeverDBEntityStandardPersistence$3.doInTransactionWithoutResult(DBSchemaPersistenceImpl.java:825)


at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)


at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)


at com.im.df.impl.db.persist.DBSchemaPersistenceImpl$ClientSeverDBEntityStandardPersistence.delete(DBSchemaPersistenceImpl.java:819)


at com.im.df.impl.db.persist.DBSchemaPersistenceImpl$ClientSeverDBEntityStandardPersistence.delete(DBSchemaPersistenceImpl.java:728)


at com.im.df.impl.db.DBEntitiesContainer.remove(DBEntitiesContainer.java:71)


at com.im.df.impl.db.DBEntitiesContainer.remove(DBEntitiesContainer.java:24)


at com.im.ijc.core.api.actions.DeleteDFEntityAction$1.phase1InRequestProcessor(DeleteDFEntityAction.java:103)


at com.im.df.util.BackgroundRunner.processTheTask(BackgroundRunner.java:112)


at com.im.df.util.BackgroundRunner$1.run(BackgroundRunner.java:79)


at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)


at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)

ChemAxon fa971619eb

13-10-2007 07:44:49

This error is coming from the database and looks like it results from failure to delete the table due to a foreign key constraint. Did you create any relationships involving that table? If so did you remove the realtionships by not remove the foreign key constraints?





You will probably need to remove the foreign key constraint manually from the database (or the table that defines the constratint).





Tim