Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
202 views
in Technique[技术] by (71.8m points)

java - Apache derby db Error ''The conglomerate (1.744) requested does not exist''

I am using the Apache derby database for a java project i work on.

I have created the table EVALUATIONCOMS an now i want to insert same values.

I try :

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();
    }
}

But i am getting the error :

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

That's the first time i run into such error and I don't know why.

I would apprisiate your help.

NOTE : I have excecuted the same method with only changing the name and columns for other tables i have in schema and everything worked ok. Also every other database handling method I use works fine as well.

question from:https://stackoverflow.com/questions/65617495/apache-derby-db-error-the-conglomerate-1-744-requested-does-not-exist

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That's "not supposed to happen". Your database has somehow become corrupt, and it's hard to tell just from this evidence what happened.

Perhaps your disk was full? Perhaps you had a crash and it didn't recover properly? Perhaps you moved your Derby database from one part of your hard disk to another while the Derby engine was still running on that database? I'm just guessing, I'm afraid.

Each table or index in your database is physically stored as a "conglomerate", and each conglomerate is a separate file in the database folder on your hard disk.

You can learn more about which conglomerate corresponds to which table or index in your database by querying the sysconglomerates system view; join it with the systables view to improve the information. See https://db.apache.org/derby/docs/10.15/ref/rrefsistabs39391.html and https://db.apache.org/derby/docs/10.15/ref/rrefsistabs24269.html

If nothing else, this analysis will help you understand which tables are damaged, and which files are missing.

And if you can reproduce this problem, perhaps you can pay more attention to exactly what actions are taking place and exactly when the file(s) disappear.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...