Package org.springframework.transaction

Examples of org.springframework.transaction.CannotCreateTransactionException


      }
      TransactionSynchronizationManager.bindResource(getConnectionFactory(), txObject.getConnectionHolder());
    }
    catch (NotSupportedException ex) {
      ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory());
      throw new CannotCreateTransactionException("CCI Connection does not support local transactions", ex);
    }
    catch (LocalTransactionException ex) {
      ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory());
      throw new CannotCreateTransactionException("Could not begin local CCI transaction", ex);
    }
    catch (Throwable ex) {
      ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory());
      throw new TransactionSystemException("Unexpected failure on begin of CCI local transaction", ex);
    }
View Full Code Here


   */
  @Override
  protected Object doGetTransaction() {
    UserTransaction ut = getUserTransaction();
    if (ut == null) {
      throw new CannotCreateTransactionException("No JTA UserTransaction available - " +
          "programmatic PlatformTransactionManager.getTransaction usage not supported");
    }
    if (!this.cacheUserTransaction) {
      ut = lookupUserTransaction(
          this.userTransactionName != null ? this.userTransactionName : DEFAULT_USER_TRANSACTION_NAME);
View Full Code Here

      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
        "JTA implementation does not support nested transactions", ex);
    }
    catch (SystemException ex) {
      throw new CannotCreateTransactionException("JTA failure on begin", ex);
    }
  }
View Full Code Here

      closeEntityManagerAfterFailedBegin(txObject);
      throw ex;
    }
    catch (Throwable ex) {
      closeEntityManagerAfterFailedBegin(txObject);
      throw new CannotCreateTransactionException("Could not open JPA EntityManager for transaction", ex);
    }
  }
View Full Code Here

        finally {
          SessionFactoryUtils.closeSession(session);
          txObject.setSessionHolder(null);
        }
      }
      throw new CannotCreateTransactionException("Could not open Hibernate Session for transaction", ex);
    }
  }
View Full Code Here

        }
        catch (Throwable ex2) {
          // ignore
        }
      }
      throw new CannotCreateTransactionException("Could not create JMS transaction", ex);
    }
  }
View Full Code Here

    MapTransactionAttributeSource tas = new MapTransactionAttributeSource();
    tas.register(m, txatt);

    PlatformTransactionManager ptm = mock(PlatformTransactionManager.class);
    // Expect a transaction
    CannotCreateTransactionException ex = new CannotCreateTransactionException("foobar", null);
    given(ptm.getTransaction(txatt)).willThrow(ex);

    TestBean tb = new TestBean() {
      @Override
      public String getName() {
View Full Code Here

        finally {
          SessionFactoryUtils.closeSession(session);
          txObject.setSessionHolder(null);
        }
      }
      throw new CannotCreateTransactionException("Could not open Hibernate Session for transaction", ex);
    }
  }
View Full Code Here

      closePersistenceManagerAfterFailedBegin(txObject);
      throw ex;
    }
    catch (Throwable ex) {
      closePersistenceManagerAfterFailedBegin(txObject);
      throw new CannotCreateTransactionException("Could not open JDO PersistenceManager for transaction", ex);
    }
  }
View Full Code Here

            "Cannot create a nested transaction because savepoints are not supported by your JDBC driver");
      }
      return conHolder.createSavepoint();
    }
    catch (SQLException ex) {
      throw new CannotCreateTransactionException("Could not create JDBC savepoint", ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.CannotCreateTransactionException

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.