Package javax.jdo

Examples of javax.jdo.Query.closeAll()


            Iterator it = results.iterator();
            if(it.hasNext()){
                b = (BookForm) it.next();
                logger.log(BasicLevel.DEBUG, b.getTitle());
            }
            query.closeAll();
            pm.currentTransaction().commit();
        } catch (Exception e) {
            if (pm.currentTransaction().isActive())
                pm.currentTransaction().rollback();
            logger.log(BasicLevel.ERROR, e);
View Full Code Here


        for (Iterator it = c.iterator(); it.hasNext();) {
            Foo f = (Foo) it.next();
            foos.add(f);
            foos.add(f.getBar());
        }
        q.closeAll();
        logger.log(BasicLevel.INFO, "Deleting " + foos.size() + " Foos and Bars.");
        pm.deletePersistentAll(foos);
        pm.currentTransaction().commit();
        pm.close();
        return this;
View Full Code Here

        Collection c = (Collection) q.execute("" + nbEmp / 2);
        for (Iterator it = c.iterator(); it.hasNext();) {
            Employee e = (Employee) it.next();
            logger.log(BasicLevel.INFO, "- Employee found:" + e.toString());
        }
        q.closeAll();
        pm.currentTransaction().commit();
       
        pm.currentTransaction().begin();
        q = pm.newQuery(Employee.class);
        c = (Collection) q.execute();
View Full Code Here

       
        pm.currentTransaction().begin();
        q = pm.newQuery(Employee.class);
        c = (Collection) q.execute();
        emps.addAll(c);
        q.closeAll();
        q = pm.newQuery(Department.class);
        c = (Collection) q.execute();
        deps.addAll(c);
        q.closeAll();
        logger.log(BasicLevel.INFO, "Delete " + deps.size() + " departments.");
View Full Code Here

        pm.evictAll();
       
        pm.currentTransaction().begin();
        Query q = pm.newQuery(Foo.class);
        foos.addAll((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(Bar.class);
        bars.addAll((Collection) q.execute());
        q.closeAll();
        logger.log(BasicLevel.INFO, "Deleting " + foos.size() + " Foos.");
        pm.deletePersistentAll(foos);
View Full Code Here

        Query q = pm.newQuery(Foo.class);
        foos.addAll((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(Bar.class);
        bars.addAll((Collection) q.execute());
        q.closeAll();
        logger.log(BasicLevel.INFO, "Deleting " + foos.size() + " Foos.");
        pm.deletePersistentAll(foos);
        logger.log(BasicLevel.INFO, "Deleting " + bars.size() + " Bars.");
        pm.deletePersistentAll(bars);
        pm.currentTransaction().commit();
View Full Code Here

        for (Iterator it = c.iterator(); it.hasNext();) {
            Address a = (Address) it.next();
            logger.log(BasicLevel.INFO, "- Address found:" + a.toString());
        }
        as = new ArrayList(c);
        q.closeAll();
        pm.currentTransaction().commit();
       
        pm.currentTransaction().begin();
        logger.log(BasicLevel.INFO, "Delete " + as.size() + " multi table addresses.");
        pm.deletePersistentAll(as);
View Full Code Here

                Worker w = (Worker) it.next();
                logger.log(BasicLevel.INFO, "\t- " + w.getFirstname());
                cpt ++;
            }
        } finally {
            q.closeAll();
            pm.currentTransaction().commit();
            pm.evictAll();
            pm.close();
        }
       
View Full Code Here

                Person p = (Person) it.next();
                logger.log(BasicLevel.INFO, "\t- " + p.getFirstname());
                cpt ++;
            }
        } finally {
            q.closeAll();
            pm.currentTransaction().commit();
            pm.evictAll();
            pm.close();
        }
View Full Code Here

                }
                logger.log(BasicLevel.INFO, "\t- " + p.getFirstname());
                cpt ++;
            }
        } finally {
            q.closeAll();
            pm.currentTransaction().commit();
            pm.evictAll();
            pm.close();
        }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.