Enlisting a JMS session as part of a distributed tx in SFSB

Consider the following method in a SFSB (Seam 2.1.2, JBoss 4.2 AS, EJB 3.0, JPA 1.0, Hibernate as persistence provider). I am trying to enlist the JMS session as part of the distributed tx and testing this using both local-tx-datasource and xa-datasource (JBoss specific datasources). Apparently the JMS session is not joining the distributed tx because everything is working fine using local-tx-datasource, which it should not. I'm guessing that there are two separate tx's that are happening here instead of one distributed tx. Also, note the following:
//topicSession = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
topicSession = conn.createTopicSession(true, TopicSession.AUTO_ACKNOWLEDGE);     The first param in the createTopicSession() method marks it as transacted, which may be used to commit all or none of multiple JMS messages in a tx (e.g. publishing multiple topics to a message queue and guaranteeing atomicity). But I was thinking that would make JTA enlist it in the distributed tx and apparently it does not.
As per section 13.2.2 of JSR220-core:
"Behind the scenes, the EJB server enlists the session on the connection to the JMS provider
and the database connections as part of the transaction. When the transaction commits, the EJB
server and the messaging and database systems perform a two-phase commit protocol to ensure atomic
updates across all the three resources."
Somebody please explain what/how the transactional semantics are in this case when enlisting a db resource mgr and a JMS session resource mgr in a distributed tx (with or w/o Seam).  thx.
SFSB:
@Name("startConversation")
@AutoCreate
@Install(true)
@Stateful
public class TestStartConversation implements TestStartConversationLocal{
@Logger
private Log log;
@In
private EntityManager em;
@In
private EntityManager em2;
private transient TopicPublisher topicPublisher;  
private transient TopicSession topicSession;
private transient TopicConnection conn;
private transient Topic topic;
public void startup(){
log.info("in startup()");
List<Hotel> list = em.createQuery("from Hotel").getResultList();
log.info("list.size() = "+list.size());
Hotel hotel = null;
if (list != null && list.size() > 0) {
hotel = list.get(0);
hotel.setAddress("arbi's house1");
try{
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("ConnectionFactory");
TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
conn = tcf.createTopicConnection();
topic = (Topic) iniCtx.lookup("topic/chatroomTopic");
//topicSession = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
topicSession = conn.createTopicSession(true, TopicSession.AUTO_ACKNOWLEDGE);            
topicPublisher = topicSession.createPublisher(topic);
topicPublisher.publish( topicSession.createObjectMessage(new ChatroomEvent("connect", "arbime")) );
topicSession.commit();            
catch(Exception e){
//noop
finally {
try {
topicSession.close();
conn.close();
catch(Exception e) {
//noop
}MDB:
@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="destination", propertyValue="topic/chatroomTopic")
@Name("logger")
public class LoggerBean implements MessageListener
@Logger Log log;
public void onMessage(Message msg)
try
ChatroomEvent event = (ChatroomEvent) ( (ObjectMessage) msg ).getObject();
log.info( "#0: #1", event.getUser(), event.getData()==null ? event.getAction() : event.getData() );
catch (JMSException jmse)
throw new RuntimeException(jmse);
}

I am using the following code now with the same results. It works w/o enlistment exception which is not what I'm expecting. So apparently there's no distributed tx? How can I check to see if there is a distributed tx and what resources (if any) have been enlisted?
private transient TopicPublisher topicPublisher;  
     private transient XATopicSession topicSession;
     private transient XATopicConnection conn;
     private transient Topic topic;
     /******************************* begin methods *******************************/
     @TransactionAttribute(TransactionAttributeType.REQUIRED)
     public void startup(){
          log.info("in startup()");
          List<Hotel> list = em.createQuery("from Hotel").getResultList();
          log.info("list.size() = "+list.size());
          try{
               InitialContext iniCtx = new InitialContext();             
               XATopicConnectionFactory tcf = (XATopicConnectionFactory) iniCtx.lookup("XAConnectionFactory");
              conn = tcf.createXATopicConnection();
              topic = (Topic) iniCtx.lookup("topic/chatroomTopic");
              topicSession = conn.createXATopicSession();         
              topicPublisher = topicSession.getTopicSession().createPublisher(topic);
              topicPublisher.publish( topicSession.createObjectMessage(new ChatroomEvent("connect", "arbime")) );
          catch(Exception e){
               //noop
          finally {
               try {
                    topicSession.close();
                    conn.close();
               catch(Exception e) {
                    //noop
     }

Similar Messages

  • The pooled JMS session is enlisted in another transaction error

    I have an MDB with pool size 2 deployed in weblogic 9.2.3(linux). I see the following error in server logs.
    <May 27, 2009 7:32:26 AM CDT> <Error> <EJB> <BEA-010079> <An error occurred while attempting to receive a message from JMS for processing by a message-driven bean: javax.jms.JMSException: [J2EE:160054]The pooled JMS session is enlisted in another transaction and may not be used elsewhere
    The exception is : javax.jms.JMSException: [J2EE:160054]The pooled JMS session is enlisted in another transaction and may not be used elsewhere
         at weblogic.deployment.jms.JMSExceptions.getJMSException(JMSExceptions.java:22)
         at weblogic.deployment.jms.WrappedTransactionalSession.enlistInTransaction(WrappedTransactionalSession.java:196)
         at weblogic.deployment.jms.WrappedMessageConsumer.receive(WrappedMessageConsumer.java:198)
         at weblogic.ejb.container.internal.JMSMessagePoller.processOneMessage(JMSMessagePoller.java:297)
         at weblogic.ejb.container.internal.JMSMessagePoller.pollContinuously(JMSMessagePoller.java:394)
         at weblogic.ejb.container.internal.JMSMessagePoller.pollForParent(JMSMessagePoller.java:517)
         at weblogic.ejb.container.internal.JMSMessagePoller.run(JMSMessagePoller.java:533)
         at java.lang.Thread.run(Thread.java:595)
    >
    any idea why this error is coming??

    Looks it is like a bug, you can ask patch for from support.

  • JMS Sessions

    Just a followup on a previous post. We have a requirement to control where exactly a CEP application commits ( acknowledges ) a JMS message.
    My question is: If I use <session-transacted> of the jms adapter config, where does the commit actually happen? Does the CEP app recover messages that are in transit coming from the jms adapter during unexpected failure?
    One reason we are foregoing this option is, the client ID is required for a Weblogic durable subscription and there is no other way to input it in the configuration.
    Our current solution is to create plain JMS subscribers using lowlevel JMS API and embed the JMS session in the message and push it down the stream as a CEP event.
    Seeking advice as to what is the most elegant solution if there are other options possible. Thank you!

    I apologize for the late response on this.
    For the first part of your question - The commit happens after the event is sent downstream from the jms adapter. So, if there is any error before a thread switch, the txn will be rolled back and it will retry the message. However, if you have a multithreaded channel downstream, the transaction will be commited after the event is put in the channel's queue.
    As for durable subscriptions - As of now we don't expose durable subscriptions through CEP configuration. This is something we will look into for a future release.
    Manju.

  • JMS Session and Container Managed Tx

              Hello,
              We have encountered the following problem:
              1) A Transaction was initiaited by the Container on EJB1.a() ("Required"-in CMT)
              2) a topic jms session was initiated by: cSession = connection.createTopicSession(
              false, TopicSession.AUTO_ACKNOWLEDGE );
              3) When I rollback the tx, all but the jms sendings roolback. Meaning the jms
              session was not a part of the tx.
              How do I relate between a jms session and a container transaction. Do I necessarily
              have to use user transaction to solve this problem?
              Many thanks in advance,
              

    Danger. Please read in-line comment.
              David Maddison wrote:
              > Hi Daniel,
              >
              > The topic session you've created isn't a transactional one, (you supplied
              > false to the transactional parameter)
              >
              > You need to use :
              >
              > cSession = connection.createTopicSession(true,
              > TopicSession.AUTO_ACKNOWLEDGE );
              >
              > To create a transactional session which will be enrolled in the CMT
              > transaction.
              >
              This is 100% wrong. Making a session transacted specifically causes JMS
              to ignore any existing transaction in favor the session's internal transaction,
              as required by the JMS specification. You need to use a connection
              that specifically checks for JTA (user) transactions. Either use an
              XAConnection
              or use a connection factory with the "user transactions enabled" flag set.
              There are number of transaction
              questions answered in the FAQ, they should point you in the right
              direction:
              http://e-docs.bea.com/wls/docs61/faq/jms.html
              The JMS programmer's guide also has this information.
              Tom, BEA
              >
              > David Maddison
              >
              > "Daniel Gordon" <[email protected]> wrote in message
              > news:[email protected]...
              > >
              > > Hello,
              > >
              > > We have encountered the following problem:
              > >
              > > 1) A Transaction was initiaited by the Container on EJB1.a()
              > ("Required"-in CMT)
              > > 2) a topic jms session was initiated by: cSession =
              > connection.createTopicSession(
              > > false, TopicSession.AUTO_ACKNOWLEDGE );
              > >
              > > 3) When I rollback the tx, all but the jms sendings roolback. Meaning the
              > jms
              > > session was not a part of the tx.
              > >
              > > How do I relate between a jms session and a container transaction. Do I
              > necessarily
              > > have to use user transaction to solve this problem?
              > >
              > > Many thanks in advance,
              > >
              > >
              

  • JMS session is not closed even after calling close()

    Hi All,
    I am using JMS to receive and publish topics for a process,in my java code i
    am creating new JMS Session on demand(ie., whenever a new topic is
    received) after processing the topic i am closing the session with close(),but
    still the session is not closed.In a period of time more sessions are created
    and FD leaks occurs which stops the process functionality.
    Later i moved the on demand session code to a static block, its working fine
    and no FD leak occurs.
    Is this a known behavior or any java bug is there to point this issue,please
    help me regarding this.
    Thanks,
    Ants Balajei

    You should try avoid creating sessions on demand but cache/pool them...
    http://activemq.apache.org/how-do-i-use-jms-efficiently.html
    James
    http://www.iona.com/
    Open Source the Enterprise Way

  • Non-durable subscribers persists after the end of their JMS session

    Hi all,
    I'm using OAQ as my JMS Provider.
    I have created code for publishing and recieving messages to/from topics. Messaging works fine, but I have one problem:
    All my non-durable subscribers persists after the end of their JMS session. I always perform unsubscribe operation in code and then closing session and connection.
    When I subscribe to topic, there's one more line in DB table ( etc. NAME: TSUB_1_24E6DB98A2EB7712E040A8C, TYPE: 65). I have expected that subscribers will be deleted after performing unsubscribe operation, but they don't...
    Can you help me with this problem? Thanks for any answer.
    Best Regards,
    Juraj

    Have you found a solution to this yet - because I face the same problem

  • Unable to create a transacted JMS Session

              We have some code that worked perfectly under wls7.0 and earlier, but refuses to
              work under wls8.1. In our situation, we are unable to create a JMS Session with
              internal transactions.
              The result of the following code
              System.out.println("transacted_=" + transacted_);
              tsession=tcon.createTopicSession(transacted_, Session.AUTO_ACKNOWLEDGE);
              System.out.println("session.getTransacted()=" + tsession.getTransacted());
              is the following
              transacted_=true
              session.getTransacted()=false
              We have tried using xa true and false; but commonly use false.
              //from config.xml
              <JMSConnectionFactory JNDIName="corej2ee.jms.JMSConnectionFactory"
              Name="CoreJMSConnectionFactory" Targets="myserver"/>
              thanks,
              jim
              

    An alternative is to modify the servlet code to use global (user)
              transactions instead of local (transacted session)
              transactions - the performance will likely be the same in your case -
              or may actually improve due to the activation of the pooling code.
              jim stafford wrote:
              > You were correct about us using the resource-ref. The documentation seemed to indicate
              > that our servlet code should have worked as initially developed, however the new
              > changes work
              >
              > //replace resource-ref lookup with env-entry to allow transacted JMS
              > //sessions. This is new with wls8.1
              > //tconFactory = (TopicConnectionFactory)
              > // ctx.lookup("java:comp/env/jms/topicFactory");
              > String factoryName =
              > (String)ctx.lookup("java:comp/env/jms/myConnectionFactory");
              > System.out.println("using global jndi name:" + factoryName);
              > tconFactory = (TopicConnectionFactory)
              > ctx.lookup(factoryName);
              > tcon = tconFactory.createTopicConnection();
              >
              > System.out.println("transacted_=" + transacted_);
              > tsession=tcon.createTopicSession(transacted_, Session.AUTO_ACKNOWLEDGE);
              > System.out.println("session.getTransacted()=" + tsession.getTransacted());
              >
              > --- output
              > Looking up topic connection factory
              > using global jndi name:corej2ee.jms.JMSConnectionFactory
              > transacted_=true
              > session.getTransacted()=true
              >
              > Tom Barnes <[email protected]> wrote:
              >
              >>Hi Jim,
              >>
              >>My first thought is that the app is running
              >>on the WL server and that the app is using EJB "resource
              >>references" to indirectly access its JMS resources.
              >>Stricter J2EE compliance in 8.1 causes JMS resources
              >>accessed via resource references to ignore the transacted flag.
              >>
              >>See "J2EE Compliance" under:
              >>http://edocs.bea.com/wls/docs81/jms/j2ee_components.html#1033768
              >>
              >>The work-around is to directly specify the JNDI name
              >>of the CF in the app directly instead of looking it up
              >>via a resource reference.
              >>
              >>Please let me know if this helps.
              >>
              >>Tom
              >>
              >>jim stafford wrote:
              >>
              >>
              >>>We have some code that worked perfectly under wls7.0 and earlier, but
              >>
              >>refuses to
              >>
              >>>work under wls8.1. In our situation, we are unable to create a JMS
              >>
              >>Session with
              >>
              >>>internal transactions.
              >>>
              >>>The result of the following code
              >>>
              >>>System.out.println("transacted_=" + transacted_);
              >>>tsession=tcon.createTopicSession(transacted_, Session.AUTO_ACKNOWLEDGE);
              >>>System.out.println("session.getTransacted()=" + tsession.getTransacted());
              >>>
              >>>is the following
              >>>
              >>>transacted_=true
              >>>session.getTransacted()=false
              >>>
              >>>We have tried using xa true and false; but commonly use false.
              >>>
              >>>//from config.xml
              >>><JMSConnectionFactory JNDIName="corej2ee.jms.JMSConnectionFactory"
              >>> Name="CoreJMSConnectionFactory" Targets="myserver"/>
              >>>
              >>>thanks,
              >>>jim
              >>
              >
              

  • I  received this email :   Formulaire N° 1-BKDI-149  Cher(e) Client(e), Votre identifiant Apple a été utilisé pour ouvrir une session iCloud à partir d'un ordinateur non autorisé. Votre compte iTunes est maintenant bloqué, veuillez accéder à votre compte

    I  received this email :
    Formulaire N° 1-BKDI-149
    Cher(e) Client(e),
    Votre identifiant Apple a été utilisé pour ouvrir une session iCloud à partir d'un ordinateur non autorisé.
    Votre compte iTunes est maintenant bloqué, veuillez accéder à votre compte afin de vérifier vos informations.
    Verifiez Maintenant
    Engagement de confidentialité
    Copyright 2013 . 1 Infinite Loop, Cupertino CA 95014 - Tous droits réservés.
    When i click on thelink i have this page 
    http://www.varunee-raikhing.com/confirmation/f88ef5e388dab9138f6d9235b7b4c1ee/it unes/
    Asking me password, credit card number too....is it apple ?or a spam? Please let me know

    Of course it's spam. Delete it.
    Best of luck.

  • J2EE.6.6 One JMS session per connection and code portability

    Hello,
    Section J2EE.6.6 of the J2EE 1.4 spec states that "Application
    components in the web and EJB containers must not attempt to
    create more than one active (not closed) Session object per connection."
    This is contrary to the API documentation for javax.jms.Connection that
    states "Because the creation of a connection involves setting up
    authentication and communication, a connection is a relatively
    heavyweight object. Most clients will do all their messaging with a
    single connection." (Indeed I found that e.g. JBoss creates seven
    threads for each connection that I create in a client).
    I want to provide a library that encapsulates the required calls to
    setup several JMS sessions. Given the above, this library must act
    differently when run within and outside an EJB container. Is there a
    portable way to determine in one's code whether the code is running
    inside or outside an EJB container?
    Regards,
    Michael Lipp

    Thanks very much for your responses. You miss, however, a very important point. Maybe I didn't emphasize this point enough in my original posting.
    I want to write a client library with a "SomeServiceFactory" that creates a "SomeService". "SomeService" happens to require several concurrent topic sessions. But this requirement is to be hidden from the user of the service. And the supplied library should be usable both in a "client container" (i.e. a stand-alone client) and in an EJB or web container (with an EJB or Servlet making use of "SomeService").
    So "SomeService" must behave differently when creating sessions, depending on whether it runs in the client container or an EJB or web container. Of course I can request the user/developer to specify some configuration file/option depending on the environment -- and then I can pray not to get too much problem reports because developers will simply forget to specify the environment as required or get things wrong.
    Or I can find a way to automatically find out about the environment my library is used in and everybody is happy -- hence my original question.

  • JMSHelper throws 'JMS server is not targetted' creating distributed queue

    I am trying to use the 8.1 weblogic.jms.extensions.JMSHelper to create a distributed queue. The target JMS servers are all migratable servers. When calling method createDistributedQueueAsync() I get a JMSException thrown compaining that the [first] JMS server is not targetted. Looking at the code provided in [http://forums.bea.com/bea/thread.jspa?messageID=200023386] which is based on the JMSHelper class source, the exception may be thrown because the target MBean is of class MigratableTargetMBean, whereas the JMSHelper is expecting class TargetMBean. Yet, the 9.0 documentation (which at least documents it) suggests that MigratableTargetMBean is derived from TargetMBean
              Does anyone have experience of this issue or its resolution, short of crafting the code by hand as per the above-referenced reply?

    Hi,
    Just to remember the configuration: 2 managed servers configured as cluster that should be deployed on 2 different machine.
    Following summary of the tests:
         - node manager + admin server + 1 managed server running on the first machine --> server failed to init with error "Server is not in the majority cluster partition"
         - node manager + admin server + 2 managed servers running on the one machine --> servers are running without errors
         - node manager + admin server + 1 managed server running on the first  machine / node manager runs on the second machine --> server on the first machine runs without errors without the famous error ' Server is not in the majority cluster partition'.
    Bottom line, seems that if the node manager is not running on the remote machine, the cluster is not in a stable state and so the single managed server failed to initialize.
    Is it according the documentation / expectations ?
    Thanks,
    Yaakov

  • JMS Sessions/Pooling on Solaris

    We have an application that uses XML events to kick off our workflow. We open
    a single QueueSession and QueueSender and send multiple messages to the workflow.
    We've observed fine behavior on Windows, but on Solaris the process that sends
    these messages appears to get hung...
    We changed over to WLQueueSession so that we could send the messages with NO_ACKNOWLEDGEMENT,
    but still we see the problem on Solaris.
    One thing I would like to try is setting up a JMSSessionPool; but I'm having problems
    setting it up. When I specify
    ConnectionFactory="weblogic.jms.ServerSessionPoolFactory"
    ListenerClass="javax.jms.QueueReceiver"
    WLS complains on startup, that the ServerSessionPoolFactory cannot be resolved
    (although it is clearly in weblogic.jar in c:\bea\wlserver\lib) and that the listener
    does not have a constructor. Alternatively I've tried setting the ListenerClass
    to "weblogic.jms.extensions.ServerSessionPoolListener" and I get the same problem.
    Please help!

    I apologize for the late response on this.
    For the first part of your question - The commit happens after the event is sent downstream from the jms adapter. So, if there is any error before a thread switch, the txn will be rolled back and it will retry the message. However, if you have a multithreaded channel downstream, the transaction will be commited after the event is put in the channel's queue.
    As for durable subscriptions - As of now we don't expose durable subscriptions through CEP configuration. This is something we will look into for a future release.
    Manju.

  • Concurrent access to JMS session in servlet

              We have a servlet that accepts a request from a browser,
              retrieves info from the request, places it in a JMS message and
              then sends the msg to a JMS Queue. We create all the JMS
              objects (connection, session, etc.) at init time (all these
              objects have class scope). There is only one session and I was
              wondering because servlets are multithreaded, while a request is
              being handled for one client, if there is a context switch in
              the middle of that client's send in order to handle another
              client's request, two different threads will be accessing the
              same session concurrently. I know the spec advises against
              this. Am I thining too much on this one????? All I have to do
              is synchronize the send call however I was just wondering if it
              was truely necessary.
              How are other people doing this out there?
              Let me know,
              Mark
              

    Hi Mark,
              You are definitely not thinking too much on this one! Multi-threading
              session access is unsafe and is definitely against spec. Either
              synchronize
              access, or, if performance is an issue, make sure each simultaneous
              sender has its
              own session.
              The WebLogic JMS Performance white paper on dev2dev.bea.com
              contains an example of a producer pool that looks like it should map
              well to your use case.
              Tom, BEA
              Mark Drifdon wrote:
              > We have a servlet that accepts a request from a browser,
              > retrieves info from the request, places it in a JMS message and
              > then sends the msg to a JMS Queue. We create all the JMS
              > objects (connection, session, etc.) at init time (all these
              > objects have class scope). There is only one session and I was
              > wondering because servlets are multithreaded, while a request is
              > being handled for one client, if there is a context switch in
              > the middle of that client's send in order to handle another
              > client's request, two different threads will be accessing the
              > same session concurrently. I know the spec advises against
              > this. Am I thining too much on this one????? All I have to do
              > is synchronize the send call however I was just wondering if it
              > was truely necessary.
              > How are other people doing this out there?
              >
              > Let me know,
              > Mark
              

  • CMT and using non-Weblogic JMS in a session bean

              I am writing a session bean which sends a JMS message using a non-weblogic JMS
              provider. This bean is marked for CMT and I want the JMS send to participate in
              this CMT as well. My understanding is that I should be able to do this by defining
              a <resource-ref> element in the ejb-jar.xml and a corresponding <resource-descriptor>
              element in the weblogic-ejb-jar.xml file. The bean would then use the <res-ref-name>
              defined under the <resource-ref> element to lookup the connection factory. What
              do I have to put in weblogic-ejb-jar.xml file to make sure that the connection
              factory specified in <res-ref-name> maps to a connection factory that is in a
              foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI) and not in
              Weblogic's JNDI?
              Thanks in advance for your help.
              

    It sounds like you're using Tibco JMS to receive messages from the MDB, and
              then to send out a message. WLS 7.0 will handle the transaction enlistment
              properly when it receives messages for the MDB, but you'll have to enlist
              the JMS provider yourself when you send the message, using the white paper
              that Tom pointed you to as a guide.
              In WLS 8.1, coming soon, we'll automatically enlist the provider in the
              transaction if you look it up using a "resource-ref" element in the EJB like
              you described. Today, you can use that element but no transaction
              enlistement is being done.
              greg
              "Venkat" <[email protected]> wrote in message
              news:[email protected]...
              >
              > We also need this feature.
              > We are using Weblogic 7.0 and Tibco JMS 3.0,
              > which supports XA.
              >
              > We are mainly interested in subscribing using MDB
              > and publishing using a session bean in one transaction.
              > Do you think by using resource-refs in conjunction
              > with registering with Weblogic JNDI during startup
              > can do the job?
              >
              > Or how about using XAConnectionFactory and XASession
              > classes for JMS publishing ?
              >
              > Thanks.
              >
              > Tom Barnes <[email protected]> wrote:
              > >Hi Mihir,
              > >
              > >Support for automatic enlistment of foreign JMS vendors
              > >via the resource-ref approach is not available in WLS.
              > >This support will be available in the next release:
              > >limited access beta is available now, public beta is available
              > >in 2-3 months. You are the first customer I've heard of that
              > >asked for this feature. Very cool. Good timing.
              > >
              > >As you are not using WebLogic JMS, you will need to do the
              > >transaction enlistment yourself. This isn't that hard
              > >to do. I suggest that you refer to the integrating foreign
              > >JMS vendor white-paper available on dev2dev.bea.com.
              > >Also, refer to the integrating transactions with
              > >MQSeries integration paper, which will likely serve your
              > >purposes better. Note that some JMS vendors
              > >have problems with concurrent transactions in a single
              > >JMS connection, or with transactions that attempt
              > >to switch threads (eg. suspend() in one thread
              > >and resume() in another).
              > >
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              msproviders.htm
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              tatransactions.htm
              > >
              > >Tom
              > >
              > >mihir sharma wrote:
              > >> I am writing a session bean which sends a JMS message using a
              non-weblogic
              > >JMS
              > >> provider. This bean is marked for CMT and I want the JMS send to
              participate
              > >in
              > >> this CMT as well. My understanding is that I should be able to do this
              > >by defining
              > >> a <resource-ref> element in the ejb-jar.xml and a corresponding
              <resource-descriptor>
              > >> element in the weblogic-ejb-jar.xml file. The bean would then use the
              > ><res-ref-name>
              > >> defined under the <resource-ref> element to lookup the connection
              factory.
              > >What
              > >> do I have to put in weblogic-ejb-jar.xml file to make sure that the
              > >connection
              > >> factory specified in <res-ref-name> maps to a connection factory that
              > >is in a
              > >> foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI)
              > >and not in
              > >> Weblogic's JNDI?
              > >>
              > >> Thanks in advance for your help.
              > >>
              > >
              >
              

  • Foreign JMS not enlisting XA Transactions

    I'm working on implementing an XA interface layer to an implementation of a foreign JMS provider and am having a problem with enlisting XA transactions in WebLogic.
    I implemented a simple JNDI that stores and retrieves serialized versions of classes in the local filesystem.
    I create an XATopicConnectionFactory named ambxatcf and a Topic named ChatterTopic and store them in there.
    The XATopicConnection implements XAConnection.
    I put a client jar in bea/weblogic91/samples/domains/wl_server/lib/ which contains the JNDI code and all of my XA classes which call the JMS.
    That gets picked up by the server on startup.
    In the Web Logic Admin Console:
    I create a Foreign Server under JMS Modules, ambrosiaServer.
    I set the JNDI Initial Context Factory set to my JNDI InitialContext class and the JNDI Properties is the path to my JNDI filestore so that it can find the serialized objects.
    I create a Foreign Destination in this server which has a Local JNDI Name: Chatter and Remote JNDI Name: ChatterTopic
    And then also in this server, I create a Foreign Connection Factory, Local JNDI Name: ambxatcf and Remote JNDI Name: XATopicConnectionFactory.
    Then in Deployments, I Install the jar containing my bean and Start it.
    Then I run the client and the bean prints out the XATopicConnectionFactory and it's the one that came out my JNDI.
    I have messages in my XATopicConnectionFactory, XATopicConnection and XATopicSession code so I know they're getting called.
    What's not getting called is XATopicSession.getXAResource() or my XAResourceImpl.start() or XAResourceImpl.commit().
    This happens whether I have the bean set up for bean managed or container managed transactions.
    I'm testing against WebLogic 9.1.
    Thanks,
    Don Hermes

    Hi Tom,
              Thank you for your response.
              I saw the article in the 8.1 documentation but I also found the following in the 9.1 docs.
              So, I assumed it would work.
              Was that assumption wrong?
              Thanks,
              Don
              =====================
              http://e-docs.bea.com/wls/docs91/jms/j2ee.html
              Automatically Enlisting Transactions
              This feature works for either WebLogic JMS implementations or for third-party JMS providers that support two-phase commit transactions (XA protocol). If a wrapped JMS connection sends or receives a message inside a transaction context, the JMS session being used to send or receive the message is automatically enlisted in the transaction through the XA capabilities of the JMS provider. This is the case whether the transaction was started implicitly because the JMS code was invoked inside an EJB with container-managed transactions enabled, or whether the transaction was started manually using the UserTransaction interface in a servlet or an EJB that supports bean-managed transactions.

  • Foreign JMS and Enlisting Transactions?

    I'm working on implementing an XA interface layer to an implementation of a foreign JMS provider and am having a problem with enlisting XA transactions in WebLogic.
              I implemented a simple JNDI that stores and retrieves serialized versions of classes in the local filesystem.
              I create an XATopicConnectionFactory named ambxatcf and a Topic named ChatterTopic and store them in there.
              The XATopicConnection implements XAConnection.
              I put a client jar in bea/weblogic91/samples/domains/wl_server/lib/ which contains the JNDI code and all of my XA classes which call the JMS.
              That gets picked up by the server on startup.
              In the Web Logic Admin Console:
              I create a Foreign Server under JMS Modules, ambrosiaServer.
              I set the JNDI Initial Context Factory set to my JNDI InitialContext class and the JNDI Properties is the path to my JNDI filestore so that it can find the serialized objects.
              I create a Foreign Destination in this server which has a Local JNDI Name: Chatter and Remote JNDI Name: ChatterTopic
              And then also in this server, I create a Foreign Connection Factory, Local JNDI Name: ambxatcf and Remote JNDI Name: XATopicConnectionFactory.
              Then in Deployments, I Install the jar containing my bean and Start it.
              Then I run the client and the bean prints out the XATopicConnectionFactory and it's the one that came out my JNDI.
              I have messages in my XATopicConnectionFactory, XATopicConnection and XATopicSession code so I know they're getting called.
              What's not getting called is XATopicSession.getXAResource() or my XAResourceImpl.start() or XAResourceImpl.commit().
              This happens whether I have the bean set up for bean managed or container managed transactions.
              I'm testing against WebLogic 9.1.
              Thanks,
              Don Hermes

    Hi Tom,
              Thank you for your response.
              I saw the article in the 8.1 documentation but I also found the following in the 9.1 docs.
              So, I assumed it would work.
              Was that assumption wrong?
              Thanks,
              Don
              =====================
              http://e-docs.bea.com/wls/docs91/jms/j2ee.html
              Automatically Enlisting Transactions
              This feature works for either WebLogic JMS implementations or for third-party JMS providers that support two-phase commit transactions (XA protocol). If a wrapped JMS connection sends or receives a message inside a transaction context, the JMS session being used to send or receive the message is automatically enlisted in the transaction through the XA capabilities of the JMS provider. This is the case whether the transaction was started implicitly because the JMS code was invoked inside an EJB with container-managed transactions enabled, or whether the transaction was started manually using the UserTransaction interface in a servlet or an EJB that supports bean-managed transactions.

Maybe you are looking for

  • Songs not playing on iPod but they do on iTunes

    I recently bought a iPod and have been transfering songs that were already on my computer to my iPod. I went to play one album and it just skipped through all the tracks and wouldn't play them. On other albums only some of the songs have been put on

  • IPod 80Gb-I convert video to ipod but doesnt have any sound

    I just bought the 80Gb ipod and i am trying to sync from my pc to my ipod all of the videos i have. at the begining someone told me it was a version problem with quicktime or itunes, so i downloaded everything in the lates versions and tryied to conv

  • Trouble skinning AS2 ComboBox component

    I'm using Flash CS3 and want to create a custom ComboBox. I've followed the steps outlined in "Editing component skins in a new document" (http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=Flash_MX_2004&fi

  • I'm in trouble with copy paste some text from Word to DW mx 2004

    I'am a new developer in webdesign. I'm doing my first site to a cliente. I'm in trouble with copy paste some text from Word to DW mx 2004. In the Edit / Preferences / General category i have the spelling dictionary in Portuguese (Brasilian). If I wro

  • Websphere to Weblogic Migration

    Hi, I am looking for some guidelines and document which can provide adequate information on doing the J2EE Application Migration from Websphere Application Server 6.1.x to Weblogic 10.x version. Thanks in Advance Sachin