Package javax.jms

Examples of javax.jms.Session.commit()


    int i;
    for (i = 0; i < 10; i++) {
      msg.setText("Msg " + i);
      pub.send(msg);
    }
    session.commit();

    System.out.println(i + " messages published.");

    cnx.close();
  }
View Full Code Here


    for (int i = 1; i <= 100000; i++) {
      message.setText("Test number " + i);
      producer.send(message);

      if ((i % 100) == 0)session.commit();

      if ((i % 1000) == 0) System.out.println(i + " messages sent");
    }
    session.commit();
   
View Full Code Here

      if ((i % 100) == 0)session.commit();

      if ((i % 1000) == 0) System.out.println(i + " messages sent");
    }
    session.commit();
   
    producer.close();
    session.close();
    cnx.close();
  }
View Full Code Here

      msg.setText("Soap test " + i);
      producer.send(queue, msg);
      System.out.println("SOAP test " + i);
    }

    sess.commit();
    cnx.close();
  }
}
View Full Code Here

      TextMessage msg = sess.createTextMessage();
      msg.setBooleanProperty("showProperties", false);
      msg.setText("Queue : Test number #" + i);
      producer.send(msg);
    }
    sess.commit();

    System.out.println("Messages sent.");

    cnx.close();
  }
View Full Code Here

      sess.commit();
     
      mSent.setText("rollback");
      producer.send(mSent);
     
      sess.commit();
     
      log.trace("Receiving 2");
      mRec = (TextMessage)consumer.receive();
      log.trace("Received 2");
      assertNotNull(mRec);
View Full Code Here

     
      TextMessage mRec2 = (TextMessage)consumer.receive();
      assertNotNull(mRec2);
      assertEquals("rollback", mRec2.getText());
     
      sess.commit();
     
      assertEquals(mRec.getText(), mRec2.getText());
     
      conn.close();
   }
View Full Code Here

         Session producerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
  
         boolean thrown = false;
         try
         {
            producerSess.commit();
         }
         catch (javax.jms.IllegalStateException e)
         {
            thrown = true;
         }
View Full Code Here

        
         log.trace("Received " + count + " messages");
  
         assertEquals(NUM_MESSAGES, count);
  
         consumerSess.commit();
        
         log.trace("Committed session");
  
         conn.stop();
         consumer.close();
View Full Code Here

               if ( (commitCounter++) % 2 == 0)
               {
                  messagesRead += (messageCount - lastCount);
                  lastCount = messageCount;
                  log.debug("commit");
                  session.commit();
               }
               else
               {
                  lastCount = messageCount;
                  log.debug("rollback");
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.