Package javax.persistence

Examples of javax.persistence.EntityTransaction.rollback()


                     }
                  }
               } while (!loaded);
            } finally {
               if (txExec != null && txExec.isActive()) {
                  txExec.rollback();
               }

            }
         } finally {
            if (emExec != null) {
View Full Code Here


        // rollback transaction and close entity manager
        EntityTransaction transaction = entityManager.getTransaction();
        if (transaction.isActive())
        {
            transaction.rollback();
        }
        entityManager.clear();
        entityManager.close();
        entityManager = null;           
    }
View Full Code Here

        // commit transaction
        EntityTransaction transaction = entityManager.getTransaction();
        if (transaction.isActive())
        {
            transaction.rollback();
        }
    }

    /* (non-Javadoc)
     * @see org.apache.wookie.beans.util.IPersistenceManager#save(org.apache.wookie.beans.IBean)
View Full Code Here

            transaction.commit();
         }
         catch (RuntimeException re)
         {
            re.printStackTrace();
            transaction.rollback();
         }
         finally
         {
            entityManager.close();
         }
View Full Code Here

         transaction.commit();
      }
      catch (RuntimeException re)
      {
         re.printStackTrace();
         transaction.rollback();
      }
      finally
      {
         entityManager.close();
      }
View Full Code Here

         return true;
      }
      catch (RuntimeException re)
      {
         re.printStackTrace();
         transaction.rollback();
      }
      finally
      {
         entityManager.close();
      }
View Full Code Here

                em.persist(person);
            }

            transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            e.printStackTrace();
        } finally {
            em.close();
        }
    }
View Full Code Here

                em.persist(person);
            }

            transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            e.printStackTrace();
        } finally {
            em.close();
        }
    }
View Full Code Here

      tx.commit();
      return true;
    }
    catch(Exception e){
      if(tx.isActive()){
        tx.rollback();
      }
      log.severe("Severe error on DAO [EntityType add(" + entity.getClass().getName() + ")] : \n\t" + e.getMessage() );
      return false;
    }
    finally{
View Full Code Here

      tx.commit();
      return entity;
    }
    catch(Exception e){
      if(tx.isActive()){
        tx.rollback();
      }
      log.severe("Severe error on DAO [EntityType merge(" + entity.getClass().getName() + ")] : \n\t" + e.getMessage() );
      throw e;
    }
    finally{
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.