Example usage for javax.persistence EntityTransaction begin

List of usage examples for javax.persistence EntityTransaction begin

Introduction

In this page you can find the example usage for javax.persistence EntityTransaction begin.

Prototype

public void begin();

Source Link

Document

Start a resource transaction.

Usage

From source file:portal.api.impl.PortalJpaController.java

public MANOprovider updateMANOprovider(MANOprovider c) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    MANOprovider resis = entityManager.merge(c);
    entityTransaction.commit();//from   ww w .  ja v  a2 s . c o m

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public void saveVxFOnBoardedDescriptor(VxFOnBoardedDescriptor mprovider) {
    logger.info("Will save VxFOnBoardedDescriptor = " + mprovider.getDeployId());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.persist(mprovider);/*from w  w  w  . j a  v a 2 s.c  o  m*/
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public VxFOnBoardedDescriptor updateVxFOnBoardedDescriptor(VxFOnBoardedDescriptor c) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    VxFOnBoardedDescriptor resis = entityManager.merge(c);
    entityTransaction.commit();//  www. j  a  v  a2  s. c  o m

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public void saveExperimentOnBoardDescriptor(ExperimentOnBoardDescriptor mprovider) {
    logger.info("Will save ExperimentOnBoardDescriptors = " + mprovider.getDeployId());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.persist(mprovider);/*from   w  w  w .j  av a2 s . c om*/
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public ExperimentOnBoardDescriptor updateExperimentOnBoardDescriptor(ExperimentOnBoardDescriptor c) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    ExperimentOnBoardDescriptor resis = entityManager.merge(c);
    entityTransaction.commit();/*from  ww w.j av  a2s  .c om*/

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public void saveInfrastructure(Infrastructure c) {
    logger.info("Will save ExperimentOnBoardDescriptors = " + c.getName());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.persist(c);// w  w  w .  j a v a 2  s .c om
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public Infrastructure updateInfrastructure(Infrastructure c) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    Infrastructure resis = entityManager.merge(c);
    entityTransaction.commit();//from  w w w  . j  a  v a  2s. c  o  m

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public void deleteUser(int userid) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    PortalUser u = entityManager.find(PortalUser.class, userid);

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();

    entityManager.remove(u);/*from  w ww.  j a va 2  s. c o  m*/

    entityTransaction.commit();
}

From source file:portal.api.impl.PortalJpaController.java

public void saveProperty(PortalProperty p) {
    logger.info("Will PortalProperty = " + p.getName());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();

    entityManager.persist(p);/*from   www.j  a va2 s. c om*/
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public void saveInstalledVxF(InstalledVxF is) {
    logger.info("Will create InstalledVxF = " + is.getUuid());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();

    entityManager.persist(is);/*from   w w  w  .  j  a  v  a2s  .  c  o  m*/
    entityManager.flush();
    entityTransaction.commit();
}