3 Replies Latest reply on Mar 21, 2002 11:09 AM by Detourniere François-Xavier

    3.0 Beta Transacted Session Problem

    Detourniere François-Xavier Newbie

      Hi, I'm using JBoss 3.0 Beta and I want to make a Stateless Session Bean publishing messages.
      When it executes the publisher.publish(message), an "Invalid Transaction Id" Exception is thrown.

      I have tried "session.getTransacted" and it returns "true" even if I use createTopicSession(false,Session.AUTO_ACKNOWLEDGE).

      This is the source code of my ejbCreate :
      public void ejbCreate() throws CreateException {
      try {
      Context messaging = new InitialContext();
      topicConnectionFactory = (TopicConnectionFactory)messaging.lookup("java:/XAConnectionFactory");
      messageTopic = (Topic) messaging.lookup("topic/CarnetTopic");
      topicConnection = topicConnectionFactory.createTopicConnection();
      topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
      System.err.println("Transac : "+topicSession.getTransacted());
      topicPublisher = topicSession.createPublisher(messageTopic);
      } catch (Exception e) {
      throw new CreateException();
      }
      }

      And this is the source code of my method publishing the message :

      TextMessage textMessage = topicSession.createTextMessage();
      TextMessage.setText(message);
      topicPublisher.publish(textMessage);

      What is the problem ??