Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityTransaction


      
    }
   
    private void deleteAll() {
        OpenJPAEntityManager manager = factory.createEntityManager();
        final OpenJPAEntityTransaction transaction = manager.getTransaction();
        try {
            transaction.begin();
            manager.createQuery("DELETE FROM JamesUser user").executeUpdate();
            transaction.commit();
        } catch (Exception e) {
            e.printStackTrace();
            if (transaction.isActive()) {
                transaction.rollback();
            }
        } finally {
            manager.close();
        }
    }
View Full Code Here


    }

    private void deleteAll() {
        OpenJPAEntityManager manager = factory.createEntityManager();
        final OpenJPAEntityTransaction transaction = manager.getTransaction();
        try {
            transaction.begin();
            manager.createQuery("DELETE FROM JamesUser user").executeUpdate();
            transaction.commit();
        } catch (Exception e) {
            e.printStackTrace();
            if (transaction.isActive()) {
                transaction.rollback();
            }
        } finally {
            manager.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.OpenJPAEntityTransaction

Copyright © 2018 www.massapicom. 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.