Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnection.destroy()


      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         mc.destroy();
         throw re;
      }
   }

   /**
 
View Full Code Here


      {
         return clf.createConnectionListener(mc, this);
      }
      catch (ResourceException re)
      {
         mc.destroy();
         throw re;
      }
   }

   /**
 
View Full Code Here

    public void destroyResource(ResourceHandle resource)
            throws PoolingException {

        try {
            ManagedConnection mc = (ManagedConnection) resource.getResource();
            mc.destroy();
        } catch (Exception ex) {
            throw new PoolingException(ex);
        }
    }
View Full Code Here

            throw e;
        } finally {
            try {
                //destroy the MC
                if (con != null) {
                    con.destroy();
                }
            } catch (Throwable e) {
                //ignore
            }
        }
View Full Code Here

      assertNotNull(textMessage);
      assertEquals(textMessage.getText(), "test");

      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testSimpleMessageSendAndReceiveXA() throws Exception
   {
      Xid xid = new XidImpl("xa1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
View Full Code Here

      assertNotNull(textMessage);
      assertEquals(textMessage.getText(), "test");

      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testSimpleMessageSendAndReceiveTransacted() throws Exception
   {
      resourceAdapter = newResourceAdapter();
View Full Code Here

      assertEquals(textMessage.getText(), "test");
      s.commit();

      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testMultipleSessionsThrowsException() throws Exception
   {
      resourceAdapter = newResourceAdapter();
View Full Code Here

         assertTrue(e.getLinkedException() instanceof IllegalStateException);
      }

      ManagedConnection mc = ((HornetQRASession)s).getManagedConnection();
      s.close();
      mc.destroy();
   }

   public void testConnectionCredentials() throws Exception
   {
      resourceAdapter = newResourceAdapter();
View Full Code Here

      QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      ManagedConnection mc = ((HornetQRASession)session).getManagedConnection();
      queueConnection.close();
      mc.destroy();

      queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testpassword");
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      mc = ((HornetQRASession)session).getManagedConnection();
View Full Code Here

      queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testpassword");
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      mc = ((HornetQRASession)session).getManagedConnection();
      queueConnection.close();
      mc.destroy();

   }

   public void testConnectionCredentialsFail() throws Exception
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.