Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.DefaultTransactionDefinition


    this.connectionFactory = connectionFactory;
  }

  public void testOutboundWithCommit() throws Exception {
    //Send the message in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);
      JmsTemplate template=new JmsTemplate(getConnectionFactory());
      template.convertAndSend(queue,TEST_MESSAGE);
View Full Code Here


    assertEquals(sentMessage,receivedMessage);
  }

  public void testOutboundWithRollback() throws Exception {
    //Send the message in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);
      JmsTemplate template=new JmsTemplate(getConnectionFactory());
      template.convertAndSend(queue,TEST_MESSAGE);
View Full Code Here

    assertEquals(message,storedMessage);
  }

  public void testOutboundWithCommit() throws Exception {
    //Update the field in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);
      JdbcTemplate template=new JdbcTemplate(getDataSource());
      template.update(UPDATE_FIELD_REQUEST,
View Full Code Here

    checkStoredMessage(TEST_FIELD_VALUE);
  }

  public void testOutboundWithRollback() throws Exception {
    //Update the field in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);
      JdbcTemplate template=new JdbcTemplate(getDataSource());
      template.update(UPDATE_FIELD_REQUEST,
View Full Code Here

    assertNull(receivedMessage);
  }

  public void testOutboundWithCommit() throws Exception {
    //Update the field and send a JMS message in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);

      //JDBC
View Full Code Here

    checkIfMessageExist(TEST_MESSAGE);
  }

  public void testOutboundWithRollback() throws Exception {
    //Update the field and send a JMS message in a JTA transaction
    DefaultTransactionDefinition definition=new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);

      //JDBC
View Full Code Here

    onSetUpBeforeTransaction();

    if (this.transactionManager != null) {
      // start a transaction
      this.transactionStatus = this.transactionManager.getTransaction(new DefaultTransactionDefinition());
        if (logger.isInfoEnabled()) {
          logger.info("Began transaction: transaction manager [" + this.transactionManager + "]; defaultRollback "
              + this.defaultRollback);
        }
    }
View Full Code Here

   * Register jobs and triggers (within a transaction, if possible).
   */
  private void registerJobsAndTriggers() throws SchedulerException {
    TransactionStatus transactionStatus = null;
    if (this.transactionManager != null) {
      transactionStatus = this.transactionManager.getTransaction(new DefaultTransactionDefinition());
    }
    try {

      if (this.jobSchedulingDataLocations != null) {
        ClassLoadHelper clh = new ResourceLoaderClassLoadHelper(this.resourceLoader);
View Full Code Here

  @Override
  public void startTrans() throws IllegalStateException {
    if(isTransStarted()) {
      throw new IllegalStateException("Transaction already started.");
    }
    final DefaultTransactionDefinition def = new DefaultTransactionDefinition();
    def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    transStatus = getTransMgr().getTransaction(def);
    transStarted = true;
  }
View Full Code Here

        stack.push(new TransactionData(pDataSource, TransactionType.DEPENDENT));
        statistics.incrementBeginCount();
    }

    public static void beginTransaction(String pDataSource) {
        DefaultTransactionDefinition tx = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
        beginTransaction(pDataSource, tx);
    }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.DefaultTransactionDefinition

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.