Package org.springframework.transaction

Examples of org.springframework.transaction.TransactionStatus


          return joinpointIdentification;
        }
      };
    }

    TransactionStatus status = null;
    if (txAttr != null) {
      PlatformTransactionManager tm = getTransactionManager();
      Assert.state(tm != null, "Property 'transactionManager' must be set on transaction aspect");
      status = tm.getTransaction(txAttr);
    }
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 {

View Full Code Here

  public Object execute(TransactionCallback action) throws TransactionException {
    if (this.transactionManager instanceof CallbackPreferringPlatformTransactionManager) {
      return ((CallbackPreferringPlatformTransactionManager) this.transactionManager).execute(this, action);
    }
    else {
      TransactionStatus status = this.transactionManager.getTransaction(this);
      Object result = null;
      try {
        result = action.doInTransaction(status);
      }
      catch (RuntimeException ex) {
View Full Code Here

   * @see #doReceiveAndExecute
   */
  protected boolean receiveAndExecute(Session session, MessageConsumer consumer) throws JMSException {
    if (this.transactionManager != null) {
      // Execute receive within transaction.
      TransactionStatus status = this.transactionManager.getTransaction(this.transactionDefinition);
      boolean messageReceived = true;
      try {
        messageReceived = doReceiveAndExecute(session, consumer, status);
      }
      catch (JMSException ex) {
View Full Code Here

            //need to propagate any exceptions back to Spring container
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
                PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null
                        || !resourceHolder.containsSession(session);
                    if (status != null && !status.isCompleted() && trans) {
                        Exception ex = inMessage.getContent(Exception.class);
                        if (ex.getCause() instanceof RuntimeException) {
                            throw (RuntimeException)ex.getCause();
                        } else {
                            throw new RuntimeException(ex);
View Full Code Here

            //need to propagate any exceptions back to Spring container
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
                PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null
                        || !resourceHolder.containsSession(session);
                    if (status != null && !status.isCompleted() && trans) {
                        Exception ex = inMessage.getContent(Exception.class);
                        if (ex.getCause() instanceof RuntimeException) {
                            throw (RuntimeException)ex.getCause();
                        } else {
                            throw new RuntimeException(ex);
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

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

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    final 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());
    final 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.TransactionStatus

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.