Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.DefaultTransactionDefinition



  public Object execute(TransactionDefinition definition, TransactionCallback callback) throws TransactionException {
    if (definition == null) {
      // Use defaults if no transaction definition given.
      definition = new DefaultTransactionDefinition();
    }

    if (definition.getTimeout() < TransactionDefinition.TIMEOUT_DEFAULT) {
      throw new InvalidTimeoutException("Invalid transaction timeout", definition.getTimeout());
    }
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


  public Object execute(TransactionDefinition definition, TransactionCallback callback) throws TransactionException {
    if (definition == null) {
      // Use defaults if no transaction definition given.
      definition = new DefaultTransactionDefinition();
    }

    if (definition.getTimeout() < TransactionDefinition.TIMEOUT_DEFAULT) {
      throw new InvalidTimeoutException("Invalid transaction timeout", definition.getTimeout());
    }
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

   * 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) {
        ResourceJobSchedulingDataProcessor dataProcessor = new ResourceJobSchedulingDataProcessor();
View Full Code Here

    sessionControl.replay();
    conControl.replay();
    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    JmsTemplate jt = new JmsTemplate(cf);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
View Full Code Here

    sessionControl.replay();
    conControl.replay();
    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    JmsTemplate jt = new JmsTemplate(cf);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
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.