tri.close();
    public static Collection[] findAll(Context context) throws SQLException    {        TableRowIterator tri = DatabaseManager.query(context, "collection",                "SELECT * FROM collection ORDER BY name");        List collections = new ArrayList();        while (tri.hasNext())        {            TableRow row = tri.next();            // First check the cache            Collection fromCache = (Collection) context.fromCache(                    Collection.class, row.getIntColumn("collection_id"));            if (fromCache != null)            {                collections.add(fromCache);            }            else            {                collections.add(new Collection(context, row));            }        }        Collection[] collectionArray = new Collection[collections.size()];        collectionArray = (Collection[]) collections.toArray(collectionArray);        return collectionArray;    }