Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.DefaultTransactionDefinition


        DefaultTransactionDefinition tx = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
        beginTransaction(pDataSource, tx);
    }

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


            // under spring. So we try to join the existing one, and if we can't, it's not active
            // (We could inspect the transaction data stack for the thread, but this isn't guaranteed
            // if the user has created transactions for themselves)
            try {
                PlatformTransactionManager qq_txn1 = pDataSource.getTransactionManager();
                TransactionStatus aTxnStatus = qq_txn1.getTransaction(new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_MANDATORY));
                qq_txn1.commit(aTxnStatus);
                return true;
            }
            catch (Exception e) {
                return false;
View Full Code Here

            // Forte manual. However, these 3 transaction types seem to be analagous to PROPEGATION_REQUIRES_NEW, PROPEGATION_NESTED
            // and PROPEGATION_REQUIRED in the Spring TransactionDefinition class. We could, therefore, implement these in this way if the
            // proper behaviour (and not just a clone of the Forte behaviour) was required.
            if (this.type != TransactionType.NESTED) {
                this.dataSource = pDataSource;
                DefaultTransactionDefinition tx = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
                this.txnManager = pDataSource.getTransactionManager();
                if (_log.isDebugEnabled()) {
                  _log.debug("Begin Transaction: " + pDataSource + ":" + tx);
                }
                this.status = this.txnManager.getTransaction(tx);
View Full Code Here

   * Register jobs and triggers (within a transaction, if possible).
   */
  protected 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

        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

        DefaultTransactionDefinition tx = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
        beginTransaction(pDataSource, tx);
    }

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

            // under spring. So we try to join the existing one, and if we can't, it's not active
            // (We could inspect the transaction data stack for the thread, but this isn't guaranteed
            // if the user has created transactions for themselves)
            try {
                PlatformTransactionManager qq_txn1 = pDataSource.getTransactionManager();
                TransactionStatus aTxnStatus = qq_txn1.getTransaction(new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_MANDATORY));
                qq_txn1.commit(aTxnStatus);
                return true;
            }
            catch (Exception e) {
                return false;
View Full Code Here

            // Forte manual. However, these 3 transaction types seem to be analagous to PROPEGATION_REQUIRES_NEW, PROPEGATION_NESTED
            // and PROPEGATION_REQUIRED in the Spring TransactionDefinition class. We could, therefore, implement these in this way if the
            // proper behaviour (and not just a clone of the Forte behaviour) was required.
            if (this.type != TransactionType.NESTED) {
                this.dataSource = pDataSource;
                DefaultTransactionDefinition tx = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
                this.txnManager = pDataSource.getTransactionManager();
                if (_log.isDebugEnabled()) {
                  _log.debug("Begin Transaction: " + pDataSource + ":" + tx);
                }
                this.status = this.txnManager.getTransaction(tx);
View Full Code Here

   * Register jobs and triggers (within a transaction, if possible).
   */
  protected 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

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.