Apache derby db 错误 请求的集团 (1.744) 不存在



我正在使用Apachederby数据库进行一个java项目。

我已经创建了EVALUATIONCOMS表,现在我想插入相同的值。

我尝试:

public void instertEvalComments(String comment) {
try {
stmt = conn.createStatement();// create a Statement
stmt.execute("INSERT INTO EVALUATIONCOMS" 
+ " VALUES ('" + comment + "')" );
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}

但我得到了错误:

java.sql.SQLException: The conglomerate (1.744) requested does not exist.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at gr.aueb.dmst.StopSpread.Database.insterIntoEvalComments(Database.java:242)
at gr.aueb.dmst.StopSpread.ServerClientThread.run(ServerClientThread.java:304)
Caused by: ERROR XSAI2: The conglomerate (1.744) requested does not exist.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.readConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.CacheableConglomerate.setIdentity(Unknown Source)
at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown Source)
at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.findConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.getStaticCompiledConglomInfo(Unknown Source)
at org.apache.derby.impl.sql.compile.InsertNode.makeConstantAction(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 4 more

这是我第一次遇到这样的错误,我不知道为什么。

我愿意请你帮忙。

注意:我改进了同样的方法,只更改了架构中其他表的名称和列,一切都很好。此外,我使用的其他数据库处理方法也很好

这是"不应该发生";。你的数据库不知何故已经损坏,很难从这些证据中判断出发生了什么。

也许你的磁盘已满?也许你发生了车祸,但没有正常恢复?也许您将Derby数据库从硬盘的一部分移到了另一部分,而Derby引擎仍在该数据库上运行?恐怕我只是猜测。

数据库中的每个表或索引在物理上都存储为"表";"砾岩";,每个企业集团都是硬盘上数据库文件夹中的一个单独文件。

通过查询sysconglomerates系统视图,您可以了解数据库中哪个企业集团对应于哪个表或索引的更多信息;将其与systables视图结合以改进信息。看见https://db.apache.org/derby/docs/10.15/ref/rrefsistabs39391.html和https://db.apache.org/derby/docs/10.15/ref/rrefsistabs24269.html

如果没有其他内容,此分析将帮助您了解哪些表已损坏,哪些文件丢失。

如果您能够重现这个问题,也许您可以更加关注正在发生的操作以及文件何时消失。

您是否尝试先删除表,然后再次创建它,然后重试?这是命令";DROP EVALUATIONCOMS";我也有同样的问题,只是从一开始就删除了他,并做了一个新的,但它经常出现,所以试着告诉我吧!好运

相关内容

最新更新