Hi Eric, Yes, that's the ODMG way of doing it. And yes, it will load all objects into memory. ODMG (and JDO as well !) was not designed with relational databases in mind. So many things that are highly efficient with SQL are not available with ODMG (JDO).
I usually recommed to bypass the ODMG (or JDO) layer in such cases and directly use the PersistenceBroker API which allows to process deleteByQuery(..) efficiently. cheers, Thomas > -----Original Message----- > From: Eric Northam [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2003 1:11 AM > To: '[EMAIL PROTECTED]' > Subject: Deleting Large Quantities > > > I was wondering if this is the appropriate way to delete a > large number of > objects with ODMG: > > (taken from OQLOrOnForeignKeyTest) > > OQLQuery query = odmg.newOQLQuery(); > query.create("select person from " + PersonImpl.class.getName()); > List persons = (List) query.execute(); > Iterator it = persons.iterator(); > while (it.hasNext()) > { > db.deletePersistent(it.next()); > } > tx.commit(); > > Won't this load each object completely into memory? > > Eric > > > > > > DISCLAIMER: The information contained in this e-mail is, > unless otherwise > indicated, confidential and is intended solely for the use of > the named > addressee. Access, copying or re-use of the e-mail or any information > contained therein by any other person is not authorized. If > you are not the > intended recipient please notify us immediately by returning > the e-mail to > the originator. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
