On 04/06/2012 19:57, Katherine Marsden wrote:
On 6/4/2012 9:29 AM, John English wrote:
I'm on 10.8, and I only have about a dozen matching rows at the
moment. No stack trace that goes further than my own code; all I have
is stuff like this:
Check the derby.log for the error and full stack trace. If the derby.log
doesn't show the error, try setting derby.infolog.append=true in the
derby.properties or system property temporarily, so you don't lose the
log when the database reboots.

The problem was that the original exception info was being masked by my
rethrowing it with the parameter information. Full version info from the
log: Apache Derby - 10.8.1.2 - (1095077)

Here's an example of a failed query and parameters:

INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM resource_usage WHERE itemid=? AND itemtype=? AND resid NOT IN (SELECT resid FROM resource_usage WHERE itemid=? AND itemtype=?))
Query parameters: 1='24' 2='final' 3='18' 4='temp' 5='24' 6='final'):

Here's the resulting stack trace from the point just before I rethrow:

java.sql.SQLException: Conglomerate could not be created.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.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.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
  at utils.DataManager.dbInsert(DataManager.java:1056)
  at actions.EditAction.copyResources(EditAction.java:1638)
  at actions.EditAction.doRelease(EditAction.java:1171)
  at actions.EditAction.processUpdates(EditAction.java:537)
  at servlets.BaseServlet.doGet(BaseServlet.java:190)
  at servlets.BaseServlet.doPost(BaseServlet.java:304)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  [... snip ...]
  at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Conglomerate could not be created.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
  ... 45 more
Caused by: ERROR XSCH4: Conglomerate could not be created.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.store.access.heap.Heap.create(Unknown Source)
at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.createConglomerate(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(Unknown Source) at org.apache.derby.impl.sql.execute.TemporaryRowHolderImpl.insert(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
  at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
  ... 39 more


--
 John English

Reply via email to