Package org.springframework.transaction

Examples of org.springframework.transaction.PlatformTransactionManager.commit()


    // TODO: This is where the DAO interface's update scripts would
    // be run.
   
    // Commit the transaction.
    try {
      transactionManager.commit(transactionStatus);
    }
    catch(TransactionException e) {
      transactionManager.rollback(transactionStatus);
      throw
        new IllegalStateException(
View Full Code Here


         }
         finally
         {
            if (currentTransaction == null)
            {
               ptm.commit(transaction);
            }
         }
      }
      return Status.STATUS_NO_TRANSACTION;
   }
View Full Code Here

      }
      finally
      {
         if (currentTransaction == null)
         {
            ptm.commit(transaction);
         }
      }
   }

   public void setTransactionTimeout(int timeout) throws SystemException
View Full Code Here

        entityManager.persist(pe1);
        entityManager.persist(office);
        entityManager.persist(cell);
        entityManager.persist(address);
               
        txMgr.commit(txStatus);
       
        Metamodel m = entityManager.getMetamodel();
        EntityType<Employee> etype = m.entity(Employee.class); //deliberately a little verbose here
        Query q = entityManager.createQuery("Select t From " + etype.getName() + " t");
        @SuppressWarnings("rawtypes")
View Full Code Here

        Calendar endDate = JPATestUtils.getCalendar(false);
        endDate.add(Calendar.DAY_OF_YEAR, 90);
        empFromDb.getEmploymentPeriod().setEndDate(endDate.getTime());
       
        entityManager.merge(empFromDb);
        txMgr.commit(txStatus);
        entityManager.clear();
       
        // Read back upated object and make sure endDate is updated
        empFromDb = entityManager.find(Employee.class, employee.getId());
        Assert.assertEquals(empFromDb.getEmploymentPeriod().getEndDate(), endDate.getTime(),
View Full Code Here

        } finally {
            try {
                if (readOnly) {
                    doRollback(transactionManager, transaction);
                } else if (!rolledBack && (isNewTransaction || commitBehavior == CommitBehavior.ALWAYS_COMMIT)) {
                    transactionManager.commit(transaction);
                }
            } catch (Throwable t) {
                Log.error(Log.JEEVES, "ERROR committing transaction, will try to rollback", t);
                doRollback(transactionManager, transaction);
            }
View Full Code Here

          next.evaluate();
        } catch (Throwable e) {
          tm.rollback(txStatus);
          throw e;
        }
        tm.commit(txStatus);
      } finally {
        database.shutdown();       
      }
    }
View Full Code Here

  public final static void testIfHasTransactional() {
    PlatformTransactionManager platformTransactionManager = new DataSourceTransactionManager(DBEnvironmentFactory
        .getCurrentDBEnvironment().getDataSource(false));
    TransactionStatus status = platformTransactionManager.getTransaction(new DefaultTransactionDefinition(
        TransactionDefinition.PROPAGATION_NEVER));
    platformTransactionManager.commit(status);
  }

  /**
   * 强行终止spring事务,如果已经存在
   */
 
View Full Code Here

        PlatformTransactionManager transactionManager = transactionManagerInstance.get();
        TransactionStatus transactionStatus = transactionStatusInstance.get();

        // commits the transaction
        transactionManager.commit(transactionStatus);
    }

    /**
     * {@inheritDoc}
     */
 
View Full Code Here

                throw new ServletException("Group:  " + entityName + " not found");
            }

            if (groupCoordinatorMapper.hasGroupCoordinatorAccessRecursively(inName, group.getId()))
            {
                transMgr.commit(transStatus);
                return group;
            }

            throw new ServletException("User " + inName + " is not a coordinator of group:  " + group.getName());
        }
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.