Michael,

Here is the java code block…

 

Neither the processTransactionResultSetRow() nor the lineItemDao.processResultSetRow() methods close the resultset.  In fact, they are included below.

 

 

      rs = ps.executeQuery();

 

      Map transactionSet = new HashMap();

      while (rs.next()) {                         //BOMBS HERE ON SECOND LOOP

        Long id = new Long(rs.getLong("TransactionId"));

        DealerTransaction transaction = (DealerTransaction) transactionSet.get(id);

        if (transaction == null) {

          transaction = processTransactionResultSetRow(rs);

          transactionSet.put(id, transaction);

          dealerTransactions.add(transaction);

        }

        transaction.addLineItem(lineItemDao.processResultSetRow(rs, connection));

      }

    } finally {

      DBHelper.closeResources(ps, rs);

    }

 

 

=====================

private DealerTransaction processTransactionResultSetRow(ResultSet rs) throws SQLException {

    DealerTransaction dealerTransaction = new DealerTransaction(rs.getLong("TransactionId"),

        rs.getDate("TransactionDate"), rs.getInt("SeedYear"), rs.getString("ShipToName"), rs.getString("ShipFromName"));

 

    dealerTransaction.setPoNumber(rs.getString("PONumber"));

    dealerTransaction.setBolNumber(rs.getInt("BillOfLadingNumber"));

    dealerTransaction.setTransactionToFrom(rs.getString("TransactionToFrom"));

    dealerTransaction.setSoldToId(rs.getString("SoldToID"));

    dealerTransaction.setSoldToIdType(rs.getString("SoldToIdType"));

    dealerTransaction.setPlantCode(rs.getString("PlantCode"));

    dealerTransaction.setPlantName(rs.getString("PlantName"));

    dealerTransaction.setTransactionNumber(rs.getString("TransactionNumber"));

    dealerTransaction.setShipToId(rs.getString("ShipToID"));

    dealerTransaction.setShipToIdType(rs.getString("ShipToIdType"));

    dealerTransaction.setSoldToName(rs.getString("SoldToName"));

 

    return dealerTransaction;

  }

 

====================

DealerTransactionDetail processResultSetRow(ResultSet rs, Connection connection) throws SQLException {

    Dealer affiliate = dealerDao.loadDealer(connection, rs.getString("AffiliateIRDAccountId"));

    Product product = productDao.loadProduct(connection, rs.getString("ProductUPC"), rs.getInt("SeedYear"));

 

    DealerTransactionDetail dealerTransactionDetail = new DealerTransactionDetail(rs.getInt("ItemNumber"), rs

            .getInt("Quantity"), DBHelper.getYesNo(rs, "IsVoided"), product, rs.getString("TransactionTypeName"), rs

            .getString("StatusName"), rs.getInt("SeedYear"));

 

    dealerTransactionDetail.setOriginalUnits(rs.getFloat("SapQuantity"));

    dealerTransactionDetail.setDamagedQuantity(rs.getFloat("DamagedQuantity"));

    dealerTransactionDetail.setLotNumber(rs.getString("LotNumber"));

    dealerTransactionDetail.setAffiliateDealer(affiliate);

    dealerTransactionDetail.setLocation(rs.getString("Location"));

    dealerTransactionDetail.setComment(rs.getString("DeliveryComment"));

    dealerTransactionDetail.setSeedSize(rs.getString("SeedSize"));

    dealerTransactionDetail.setUserDate(rs.getDate("UserDate"));

    dealerTransactionDetail.setProductSapId(rs.getLong("ProductSapId"));

    dealerTransactionDetail.setSapUom(rs.getString("SapUnitOfMeasure"));

    return dealerTransactionDetail;

  }

 

Thanks!

 

-Alan Baldwin-

 

 

-----Original Message-----
From: Michael Segel [mailto:msegel@segel.com] On Behalf Of derby@segel.com
Sent:
Thursday, August 31, 2006 5:05 PM
To: '
Derby Discussion'
Subject: RE: SQLException: The heap container with container id Container(-1, 1157060695837) is closed.

 

Can you provide some code of the loop?

It sounds like you’re closing out the result set.

But hey! What do I know?

 


From: BALDWIN, ALAN J [AG-Contractor/1000] [mailto:alan.j.baldwin@monsanto.com]
Sent:
Thursday, August 31, 2006 5:01 PM
To: derby-user@db.apache.org
Subject: SQLException: The heap container with container id Container(-1, 1157060695837) is closed.

 

Hello all,

I'm running a query from java that throws the exception in the subject.  The code that fails is when calling rs.next() *on the second iteration only*.  I can't seem to find anything on the web regarding this error.   Could someone point me in the right direction?

Regards,

Alan Baldwin

This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.

This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.