tri.close();
    public Collection[] getCollections() throws SQLException    {        List collections = new ArrayList();        // Get collection table rows        TableRowIterator tri = DatabaseManager                .query(                        ourContext,                        "collection",                        "SELECT collection.* FROM collection, collection2item WHERE "                                + "collection2item.collection_id=collection.collection_id AND "                                + "collection2item.item_id="                                + itemRow.getIntColumn("item_id"));        while (tri.hasNext())        {            TableRow row = tri.next();            // First check the cache            Collection fromCache = (Collection) ourContext.fromCache(                    Collection.class, row.getIntColumn("collection_id"));            if (fromCache != null)            {                collections.add(fromCache);            }            else            {                collections.add(new Collection(ourContext, row));            }        }        Collection[] collectionArray = new Collection[collections.size()];        collectionArray = (Collection[]) collections.toArray(collectionArray);        return collectionArray;    }