EntityManager.persist and JMS messaging issues?

Hi everyone:
I am seeing a problem that I could not figure out a solution. Can anyone shed me some lights on this?
I have a EJB method which basically does 2 things: 1). persists a record into a database table using EntityManager 2). sends out a message to a JMS topic. So it is th like:
myMethod() {
entityManager.persist(myObj);
notifier.notify(...);
The client will then listen to the JMS topic and read the new record from database. Usually this works pretty well, but sometimes, the client cannot find the new record from database at all and a few seconds later it can. It is as if there is a delay between the JMS messaging and database persistence - somehow the client receives the message first and at this time the record is not really saved into database yet!
Can anyone explain to me what is going on here? What kind of solutions might help to resolve this?
BTW, I am using the Hibernate EntityManager. My app server is Glassfish.
Thanks a lot for your help
jmao

You need to use flush method to persist the value before you calling notifier.notify(...);
below code should works
myMethod() {
entityManager.persist(myObj);
*entityManager.flush();</<br />
notifier.notify(...);
}

Similar Messages

  • Weird things when persisting the jms messages of topic in the wls9?

    I am testing the store of the jms messages in wls9.
              But when i sent a topic message to the topic, it seems that the message cannot be stored to the persistent stores.
              The things were that:
              when i send a message of queue and refreshed the page of console of wls9.I saw the number changed in :"Home > Summary of Persistent Stores > exampleJDBCStore "-Monitoring-Statistics,the "Create Count" had increased.
              But when i use the topic message, the "Create Count" never changed.
              Anybody can tell me why?
              Is the topic message cannot be stored in persistent stores, or others ?
              thx and rgds.

    Topic messages are not persisted unless both the publisher qos is persistent and there are existing durable subscribers. Otherwise, there is no need to persist them. Do you have any durable subscribers?
              Tom

  • WAS and JMS Message Server

    Does WAS provide a JMS messaging server (as distinct to just the JMS J2EE interface)? If I want to use WAS and JMS do I need to provide my own server or is it part of WAS?

    Hi Rick,
    Yes, SAP Web AS comes with a JMS messaging server (called JMS provider). For more information please refer to the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/a3/63af1bbf09469fa1615c05f0daff6f/frameset.htm">Development Manual</a> or <a href="http://help.sap.com/saphelp_nw04/helpdata/en/90/57849e5e3e45d784afc4e3bfa8136f/frameset.htm">Administration Manual</a>
    Hope that helps!
    Vladimir

  • Spring and Jms message: no message in the queue

    Hi all,
    this is my application
    Spring 3.0.5 + Oc4j 10.1.3.3 + Oracle DB + Oracle Aq
    This is the flow:
    1. Update datas
    2. Send jms message
    The application updates correctly datas, in the same transaction sends a message to an oracle jms queue but the queue table is empty.
    Transaction starts with method avvService.updateStatoService()
    This is a log snapshot
    2013-02-07 11:04:48,982 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:365) CLIENT: HOST: - Creating new transaction with name [it.mycompany.gevi.service.avvenimenti.AvvenimentoService.updateStatoAvvenimentoService]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-java.lang.Exception
    2013-02-07 11:04:52,340 [DEBUG] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO.updateService - getStatement 
    2013-02-07 11:04:52,340 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - SQL is:
              UPDATE TABLE_NAME
              SET STATO = ?
              WHERE COD = ?
    2013-02-07 11:04:52,918 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - {1=1, 2=1200300146}
    2013-02-07 11:04:52,949 [INFO] it.mycompany.gevi.service.GenericService.updateService(GenericService.java:50) CLIENT: HOST: - Risultato updateService:1
    2013-02-07 11:04:52,965 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:470) CLIENT: HOST: - Participating in existing transaction
    2013-02-07 11:04:53,730 [DEBUG] org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:464) CLIENT: HOST: - Executing callback on JMS Session: oracle.jms.AQjmsSession@ee2a92
    2013-02-07 11:04:54,167 [DEBUG] org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:567) CLIENT: HOST: - Sending created message: oracle.jms.AQjmsTextMessage@27fdb9
    2013-02-07 11:04:54,526 [INFO] it.mycompany.gevi.service.JMSSenderService.sendMessage(JMSSenderService.java:64) CLIENT: HOST: - JSM Message Sent!
    2013-02-07 11:04:54,526 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:752) CLIENT: HOST: - Initiating transaction commit Spring bean configuration file
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:jee="http://www.springframework.org/schema/jee"
         xmlns:orcl="http://www.springframework.org/schema/data/orcl"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="
              http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/tx
              http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
              http://www.springframework.org/schema/aop
              http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd
              http://www.springframework.org/schema/task
              http://www.springframework.org/schema/task/spring-task-3.0.xsd
              http://www.springframework.org/schema/data/orcl
              http://www.springframework.org/schema/data/orcl/spring-data-orcl-1.0.xsd
              http://www.springframework.org/schema/jee
              http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"
         default-lazy-init="true" default-autowire="byName">
         <jee:jndi-lookup id="geviDs" jndi-name="jdbc/DBGeviDS" />
         <jee:jndi-lookup id="geviAqAdmDs" jndi-name="jdbc/AQAdmGeviDS" />
         <orcl:aq-jms-connection-factory id="topicConnectionFactory" data-source="geviAqAdmDs"
          connection-factory-type="TOPIC_CONNECTION" />
         <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
              <property name="sessionTransacted" value="true"/>
            <property name="connectionFactory" ref="topicConnectionFactory"/>
            <property name="explicitQosEnabled" value="true"/>
            <property name="timeToLive" value="60000"/>
            <property name="pubSubDomain" value="true"/>
            <property name="defaultDestinationName" value="VR_INFO_VAR_TOPIC"/>
        </bean>
         <tx:jta-transaction-manager/>
         <tx:annotation-driven transaction-manager="transactionManager"  proxy-target-class="true" />
         <aop:config>
              <aop:pointcut id="genericServiceMethods" expression="execution(* it.mycompany.gevi.service..*Service.*(..))" />
              <aop:advisor pointcut-ref="genericServiceMethods" advice-ref="txServiceAdvice"/>
         </aop:config>
         <tx:advice id="txServiceAdvice" transaction-manager="transactionManager">
              <tx:attributes>
                   <tx:method name="read*Service" read-only="true"/>
                 <!-- Other methods use the default transaction settings (see below) -->
                 <tx:method name="insertReturning*Service"    propagation="REQUIRED" />
                 <tx:method name="create*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="delete*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="update*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="sendMessage" propagation="REQUIRED" rollback-for="java.lang.Exception" />
              </tx:attributes>
         </tx:advice>
         <bean name="genericService" class="it.mycompany.gevi.service.GenericService" />
         <bean name="avvService" class="it.mycompany.gevi.service.avvenimenti.AvvenimentoService"/>
         <bean name="jmsSender" class="it.mycompany.gevi.service.JMSSenderService" >
              <property name="jmsTemplate" ref="jmsTemplate"/>
         </bean>
    </beans>Thanks in advance.

    Hi all,
    this is my application
    Spring 3.0.5 + Oc4j 10.1.3.3 + Oracle DB + Oracle Aq
    This is the flow:
    1. Update datas
    2. Send jms message
    The application updates correctly datas, in the same transaction sends a message to an oracle jms queue but the queue table is empty.
    Transaction starts with method avvService.updateStatoService()
    This is a log snapshot
    2013-02-07 11:04:48,982 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:365) CLIENT: HOST: - Creating new transaction with name [it.mycompany.gevi.service.avvenimenti.AvvenimentoService.updateStatoAvvenimentoService]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-java.lang.Exception
    2013-02-07 11:04:52,340 [DEBUG] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO.updateService - getStatement 
    2013-02-07 11:04:52,340 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - SQL is:
              UPDATE TABLE_NAME
              SET STATO = ?
              WHERE COD = ?
    2013-02-07 11:04:52,918 [INFO] it.mycompany.service.qbuilder.logic.QBUpdateService.doExecute(QBUpdateService.java:62) CLIENT: HOST: - DAO - {1=1, 2=1200300146}
    2013-02-07 11:04:52,949 [INFO] it.mycompany.gevi.service.GenericService.updateService(GenericService.java:50) CLIENT: HOST: - Risultato updateService:1
    2013-02-07 11:04:52,965 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:470) CLIENT: HOST: - Participating in existing transaction
    2013-02-07 11:04:53,730 [DEBUG] org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:464) CLIENT: HOST: - Executing callback on JMS Session: oracle.jms.AQjmsSession@ee2a92
    2013-02-07 11:04:54,167 [DEBUG] org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:567) CLIENT: HOST: - Sending created message: oracle.jms.AQjmsTextMessage@27fdb9
    2013-02-07 11:04:54,526 [INFO] it.mycompany.gevi.service.JMSSenderService.sendMessage(JMSSenderService.java:64) CLIENT: HOST: - JSM Message Sent!
    2013-02-07 11:04:54,526 [DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:752) CLIENT: HOST: - Initiating transaction commit Spring bean configuration file
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:jee="http://www.springframework.org/schema/jee"
         xmlns:orcl="http://www.springframework.org/schema/data/orcl"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="
              http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/tx
              http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
              http://www.springframework.org/schema/aop
              http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd
              http://www.springframework.org/schema/task
              http://www.springframework.org/schema/task/spring-task-3.0.xsd
              http://www.springframework.org/schema/data/orcl
              http://www.springframework.org/schema/data/orcl/spring-data-orcl-1.0.xsd
              http://www.springframework.org/schema/jee
              http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"
         default-lazy-init="true" default-autowire="byName">
         <jee:jndi-lookup id="geviDs" jndi-name="jdbc/DBGeviDS" />
         <jee:jndi-lookup id="geviAqAdmDs" jndi-name="jdbc/AQAdmGeviDS" />
         <orcl:aq-jms-connection-factory id="topicConnectionFactory" data-source="geviAqAdmDs"
          connection-factory-type="TOPIC_CONNECTION" />
         <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
              <property name="sessionTransacted" value="true"/>
            <property name="connectionFactory" ref="topicConnectionFactory"/>
            <property name="explicitQosEnabled" value="true"/>
            <property name="timeToLive" value="60000"/>
            <property name="pubSubDomain" value="true"/>
            <property name="defaultDestinationName" value="VR_INFO_VAR_TOPIC"/>
        </bean>
         <tx:jta-transaction-manager/>
         <tx:annotation-driven transaction-manager="transactionManager"  proxy-target-class="true" />
         <aop:config>
              <aop:pointcut id="genericServiceMethods" expression="execution(* it.mycompany.gevi.service..*Service.*(..))" />
              <aop:advisor pointcut-ref="genericServiceMethods" advice-ref="txServiceAdvice"/>
         </aop:config>
         <tx:advice id="txServiceAdvice" transaction-manager="transactionManager">
              <tx:attributes>
                   <tx:method name="read*Service" read-only="true"/>
                 <!-- Other methods use the default transaction settings (see below) -->
                 <tx:method name="insertReturning*Service"    propagation="REQUIRED" />
                 <tx:method name="create*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="delete*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="update*Service" propagation="REQUIRED" rollback-for="java.lang.Exception"/>
                 <tx:method name="sendMessage" propagation="REQUIRED" rollback-for="java.lang.Exception" />
              </tx:attributes>
         </tx:advice>
         <bean name="genericService" class="it.mycompany.gevi.service.GenericService" />
         <bean name="avvService" class="it.mycompany.gevi.service.avvenimenti.AvvenimentoService"/>
         <bean name="jmsSender" class="it.mycompany.gevi.service.JMSSenderService" >
              <property name="jmsTemplate" ref="jmsTemplate"/>
         </bean>
    </beans>Thanks in advance.

  • SRM 5 BBPSTART - System ID and System Messages issues

    Hi all,
    We just upgraded to SRM 5.0 from SRM 3.0
    The shopping cart logon page(bbpstart) doesn't show System ID and also the system Messages also doesn't work on browser when we set message by sm02.
    I already checked "System ID" and "System messages" from "Select Display" under System Logon Settings from bbpstart>Error Pages>Logon Errors>Configuration>System Logon Settings.
    I searched over the net and can't find anything. I only found a notes for the System messages, but it was for the older release and SRM 5 already applied that note. So I don't know what else I can do.
    Thanks for the itime.
    Kev

    Hello Thomas,
    It is not possible to run a system landscape with 2 identical SID's. And even if you do get it running in some kind of freeky way the system would be very instable (how would you know a transport has gone to the right system?).
    A system copy and a <SID> change is still possible. However, SAP recommends to do an export and an import of your database. Allthough this is the best and the least confusing way (and labour extensive), it is not really necessary.
    If you do a backup/restore procedure with a <SID> change, lets say from PRD to DEV, you will end up with a system that has DEV as <SID> but your tablespaces will look like PSAP-PRD-620. The owner of the database will also be sapprd. This is no problem at all to run the system, it is only confusing.
    I know it works, I've got it running. I've also got a sandbox running with user saptsc and database owner cbdamd and <SID> CBD.
    Kind regards,
    Pascal Ottens

  • 4.4.2 RAZR Maxx HD Battery life and Text messaging issues

    So I finally got the update to Kit Kat (4.4.2) over the weekend. After installing I've noticed a couple of problems.
    1. The battery life plummeted. I went from lasting about 2 days on a charge to having to recharge after about 12 hours (went from 100% to 32%). Also, the phone was running hot (battery). I checked the apps that were running and found some that I had not used since the update were running and my RAM usage was much higher than normal. I force stopped them and have been running normal for the past 3 days, so I think this may have been a one time thing.
    2. What happened to the text message app? I'm getting notifications that I'm getting text messages (the "Messaging" icon will show a orange square with the number of new texts) but it doesn't show me any new text messages. I also get no notification from the Circles widget (in the circle that displays the time) and nothing on the black status bar at the top of the screen, just the Messaging icon. Going into the Messaging app doesn't show any new messages, but the notification on the app remains. If I wait long enough (anywhere from 15 minutes to 2 hours so far) the message will finally come through (as well as the other notifications). It's like the phone knows I've gotten a text but won't download it for an extended period of time. This makes carrying a conversation via text next to impossible. This is going on as I type. For about 20 minutes I've got a notification on the messaging app that says I've got 1 new text but when I check it there is no new text displayed. The last text showing up is from a few hours ago. What the heck is going on?

        I'm sorry you're having issues with the battery on your device bljusn. I know its frustrating and thanks for trying all those steps to correct the issue. The hard reset would be the last step towards fixing some of the issues with your phone. When you perform the hard reset, make sure you don't restore your apps because they could be causing some of the issues with your phone if their not compatible with the new software. We recommend adding them on one by one to check for issues. Keep us posted.
    KinquanaH_Vzw
    Follow us on Twitter @vzwsupport

  • E7 MFE and Nokia Messaging Issues

    Hi I have the following issues with my Nokia E7-00: BEFORE ANNA UPDATE: 1. With MFE on Hotmail: Only Inbox will sync. Other folders will not sync. Contacts and Calendar sync well, no problem. If i send an email from my device, i receive that email, it is there on the Sent folder on the server, but not on my device. 2. With Nokia Messaging: Only Inbox and Sent folders will sync. Junk and Draft folders will not sync. AFTER ANNA UPDATE: 1. With MFE on Hotmail: Same as BEFORE ANNA UPDATE. 2. With Nokia Messaging: When i configure Hotmail / Gmail / Yahoo, it says "cannot enable the service that gives you full access to the features..." Any thoughts? Thank you in advance!

    Have you tried to check whether the synchronization success or fail?
    To check it:
    Open the Nokia Messaging Email screen
    Open 'Options' menu (left soft key)
    Choose 'Connection Info'
    Some info displayed are:
    last sync date and time, last sync status (successful or failed), last successful sync date and time
    http://cartoonized.net

  • Insurt photo and get message issue id="THREE_PIXEL_JOG" name="Three Pixel Text Jog"/

    I insert a photo size 300 x225 and when I check it the size is 3X3 what is wrong.

    My wild, flat out guess is you have placed the image without an html width or height attribute and your id of "THREE_PIXEL_JOG" is set to a height and width of 3px in the css.
    If that's not the case, we'll need to see your code and image. A link to your malfunctioning page, here in the forum, would be the best way to do that.

  • JMS messages sometimes not received by Flex client

    We have a problem that Flex client is sometimes not able to
    receive JMS messages from a JBoss JMS Queue. Most of the time it
    works, but if users logout/login using the same account frequently
    or you restart JBoss 4.0.4 during their session then it might
    happen. Then it doesn't work at all even if you wait. Client is
    able to send messages when this problem occurs, which can then be
    intercepted by other clients but cannot receive any messages from
    himself or from the others. JBoss 4.0.4 is running in cluster mode.
    Could it be that there is an old frozen session which is receiving
    the messages meant for the new client?(consumer selector is unique
    to each user, but if a user logs in twice, the same selector is
    used) If I run 2 instances of my JMS test consumer using the same
    selector then the consumer which registered later receives the
    messages and if it quits, then the older consumer starts receving
    them. This doesn't occur in Flex.
    Flex is running on Tomcat 5.5.17.
    Our messaging-config.xml is
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="message-service"
    class="flex.messaging.services.MessageService"
    messageTypes="flex.messaging.messages.AsyncMessage">
    <adapters>
    <adapter-definition id="actionscript"
    class="flex.messaging.services.messaging.adapters.ActionScriptAdapter"
    default="true" />
    <adapter-definition id="jms"
    class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
    </adapters>
    <destination id="JMSQueueB">
    <properties>
    <network>
    <session-timeout>10</session-timeout>
    </network>
    <jms>
    <initial-context-environment>
    <property>
    <name>java.naming.factory.url.pkgs</name>
    <value>org.jboss.naming:org.jnp.interfaces</value>
    </property>
    <property>
    <name>Context.PROVIDER_URL</name>
    <value>jnp://x.x.x.x:1100,jnp://x.x.x.y:1100</value>
    </property>
    <property>
    <name>Context.INITIAL_CONTEXT_FACTORY</name>
    <value>org.jnp.interfaces.NamingContextFactory</value>
    </property>
    </initial-context-environment>
    <destination-type>Queue</destination-type>
    <message-type>javax.jms.TextMessage</message-type>
    <connection-factory>ConnectionFactory</connection-factory>
    <destination-jndi-name>queue/B</destination-jndi-name>
    <destination-name>B</destination-name>
    <delivery-mode>PERSISTENT</delivery-mode>
    <message-priority>DEFAULT_PRIORITY</message-priority>
    <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
    <transacted-sessions>false</transacted-sessions>
    </jms>
    </properties>
    <channels>
    <channel ref="my-rtmp"/>
    <channel ref="my-secure-amf"/>
    </channels>
    <adapter ref="jms"/>
    </destination>
    </service>
    Part of our actionscript code:
    pmConsumer = new Consumer();
    pmConsumer.destination = "JMSQueueB";
    pmConsumer.selector = "some jms selector ....";
    pmConsumer.addEventListener(MessageEvent.MESSAGE,
    presenceMessageHandler);
    pmConsumer.addEventListener(MessageFaultEvent.FAULT,
    faultHandler);
    pmConsumer.addEventListener(ChannelFaultEvent.FAULT,
    channelFaultHandler);
    pmConsumer.subscribe();
    Also Flex seems to be handing channel switching incorrectly,
    if rtmp port is firewalled, it won't use amf properly even though
    it was given 2 channels in configuration file and JMS messaging
    doesn't work. We have to alter the channel set during runtime.
    Flex also doesn't automatically switch to other JMS server if
    one goes down. Is this a feature or a bug? We have to reset
    producer and consumer in order for this to work.

    Hi,
    It was in earlier version of the OS that you could turn Bonjour On and Off.
    If this can be done in Leopard and Snow Leopard I have not found it yet. (But I don't look that often and nor for very long)
    This Forum may help with that
    I would also try a PRAM reset. (on Both computers)
    Shut down the computer.
    Restart it holding down APPLE(or ⌘)ALT+PR Keys until you have heard three Start Up Bongs.
    7:18 PM Tuesday; December 8, 2009
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • JMS Messages Refusing to participate in JTA transaction

    I have been working on this issue for several days, and I cannot find a path out.
    I have a situation where I need to write to the database and also send out a JMS message. I want either both to work, or nothing to work, so its a straightforward JTA application, so I would think.
    The JMS connection factory in use is set to participate in XA transactions (I have checked this 10 times).
    I originally had a UserTransaction started and committed around these statements, but since this did not seem to be working, I put all the code in an EJB with transaction Required.
    Either way, it is not working the way I expect.
    I have a break point in the MDB that receives the message, as well as a break point on the publisher code and the code immediately after it. I find every time that as soon as I step past the JMS publish, the breakpoint in the MDB stops next, indicating that the JMS message was sent out, even though the publishers transaction is definitely not completed -- eventually the debugger will return back to the next line after the publish.
    I am pretty sure we have done this many times in the past, and it has worked like I expect transacted code to work.
    Anyone have any ideas on obvious things to check to determine why the JMS message is going out outside of the transaction? Or not so obvious...
    Thanks in advance,
    ken clark

    Hi Ken,
    You're right -- the use case is common, but there are a couple pitfalls that new users sometimes run into.
    The break-point tracing results that you have are expected. A sender's message goes to the JMS server while the message send call is made. If the message is participating in the transaction, it is still sent, but it won't become visible to consumers until the transaction is later committed.
    To ensure that a sent message participates in a transaction:
    1 - ensure the connection factory is "XA enabled"
    2 - ensure there's a transaction on the thread. For example: System.out.println("MY TX" + weblogic.transaction.TransactionHelper.getTransactionHelper().getTransaction());
    3 - ensure that your connection.createSession() invoke passes "false" for the first parameter -- not true! if true and you're not using a resource ref, then the session becomes a "transacted" session, and JMS messages will participate in an independent local transaction rather than the global XA transaction
    4 - If not using a WebLogic JMS to send, then you need to ensure that WebLogic automatically enlists the foreign vendor send call in the WL TX. All that is required is to use a standared JEE "resource reference" to obtain the CF. rather than directly looking up the foreign CF in the foreign JNDI provider. This lets WebLogic detect and wrap the application's foreign vendor calls, which in turn enables automatic enlistment. See the WebLogic JMS Interop FAQ for more info.
    4B - If you're using AQ-JMS to send, more work is required, as AQ-JMS is fairly unique among JMS implementations. WL 10.3.1 and later provides features to simplify this work.
    For a related FAQ see [ Integrating Remote JMS Providers | http://download.oracle.com/docs/cd/E15523_01/web.1111/e13727/interop.htm#JMSPG553 ], and for resource ref info see [ Enhanced Support for Using WebLogic JMS with EJBs and Servlets|http://download.oracle.com/docs/cd/E15523_01/web.1111/e13727/j2ee.htm#g1329180 ] (especially example 9-5).
    Hope this helps,
    Tom

  • JMS Message ordering

    What does the JMS specification (in J2EE version 1.3) say about queues having to support message ordering for messages of the same priority?
    Is this a requirement or not....?
    Thanks for your help.
    Brent Miller
    Chicago, IL

    Hi,
    About the order of message receipt, JMS1.1 specs say that Messages consumed by a session define a serial order. JMS defines that messages sent by a session to a destination must be received in the order in which they were sent. However, JMS does not define order of message receipt across destinations or across a destination's messages sent from multiple sessions.
    However, an important point to note here is that several things can affect this order:
    1) Messages of higher priority may be received before previous lower priority messages sent.
    2) A client may not receive a NON_PERSISTENT messages due to a JMS provider failure.
    3) If both PERSISTENT and NON_PERSISTENT messages are sent to a destination, order is only guaranteed within delivery mode i.e. a later NON_PERSISTENT message may be received before an earlier PERSISTENT message. However, it will definitely arrive ahead of an earlier NON_PERSISTENT message with the same priority.
    Manish

  • Messages could not persist in jms Topic

    Hi,
    I implement JMS Topic in a SOA project in a cluster (two nodes) environment.
    The problem is,
    1. The jms topic service executes twice (because of 2 nodes in my cluster) and the message is also replicates but shows as a single message.
    To overcome the above issue, I use "singleton" property in composite as well as EM console.
    Then above problem has been resolved but creates below issue.
    2. The issue is, in my case 2 servers in my cluster, if first server comes first to running state and jms Topic produces messages to first server.. then messages
    persists pretty good.
    But if first server comes first to running state and jms Topic produces messages on to 2nd server then messages are deleted immediately when they produced.
    and vice-versa for 2nd server comes first to running state.
    Friends, please help me on this.
    Regards,
    Venkat
    Edited by: Pasagad on Mar 20, 2013 6:11 AM

    What type of topic have you created ? Try not to create a distributed topic instead create topics for each managed server with same local jndi name.
    see this blog: http://soa-street.blogspot.com/2010/08/subscribing-to-distributed-topic-within.html

  • Lost (and found) JMS - messages

              Using WLS 6.1 and have experienced that JMS messages has not been delivered to
              its consumer correctly. We are interested in any suggestions to what has happend,
              what can be done to avoid the problem in the future, or perhaps how we can find
              out more about the problem.
              We have a message driven bean A which sends messages to the queue Q, of which
              the message driven bean B is the only consumer.
              What we recently have experienced is that some of the messages delivered by A
              to Q never are delivered to B. But the messages seems to be persisted correctly,
              because after a restart they reappear!
              Following is a more detailed description of the scenario:
              1. A message is sendt with DeliveryMode=PERSISTENT and TimeToLive=0. QueueSender.send
              is invoked and returns normally.
              2. The consumers never gets the message (B.onMessage i never invoked with this
              message).
              3. Point 1-2 is repeated for 13 different messages over a period when ~100 similar
              messages are delivered normally.
              4. The server is then restarted.
              5. In the starup log it is indicated that 44 records are found in the JMSStore.
              6. When the server restarts, the "lost" messages gets delivered to B.
              After the server restart we have not experienced the problem again.
              Logs does not show anything unusual about the previous restart.
              Other details:
              There is always exatly 1 instance of A running, and 5-20 instances of B. A implements
              and uses a pool of javax.jms.XAQueueSession instances, which shares a single instance
              of javax.jms.XAQueueConnection. The aknowledge-mode for B is "Auto-aknowledge".
              We're using Weblogic Server 6.1.3.0 / Red Hat Linux 7.3.
              Any help on this problem is appreciated!
              

              I believe we've seen just the behaviour you describe on 6.1 SP2, but only on a
              multi-cpu box (Solaris), and only under load. We can't reproduce the problem reliably,
              and get no error messages/warnings anywhere, so very little to send to customer
              support; by the time we notice this, the problem's long passed, so a thread dump's
              of no use.
              We're going to try and see how SP5 (which has loads of JMS fixes) pans out.
              But if you find anything out, could you post here?
              simon.
              "Harald Stendal" <[email protected]> wrote:
              >
              >Using WLS 6.1 and have experienced that JMS messages has not been delivered
              >to
              >its consumer correctly. We are interested in any suggestions to what
              >has happend,
              >what can be done to avoid the problem in the future, or perhaps how we
              >can find
              >out more about the problem.
              >
              >We have a message driven bean A which sends messages to the queue Q,
              >of which
              >the message driven bean B is the only consumer.
              >What we recently have experienced is that some of the messages delivered
              >by A
              >to Q never are delivered to B. But the messages seems to be persisted
              >correctly,
              >because after a restart they reappear!
              >
              >Following is a more detailed description of the scenario:
              >
              >1. A message is sendt with DeliveryMode=PERSISTENT and TimeToLive=0.
              >QueueSender.send
              >is invoked and returns normally.
              >2. The consumers never gets the message (B.onMessage i never invoked
              >with this
              >message).
              >3. Point 1-2 is repeated for 13 different messages over a period when
              >~100 similar
              >messages are delivered normally.
              >4. The server is then restarted.
              >5. In the starup log it is indicated that 44 records are found in the
              >JMSStore.
              >6. When the server restarts, the "lost" messages gets delivered to B.
              >
              >After the server restart we have not experienced the problem again.
              >
              >Logs does not show anything unusual about the previous restart.
              >
              >Other details:
              >There is always exatly 1 instance of A running, and 5-20 instances of
              >B. A implements
              >and uses a pool of javax.jms.XAQueueSession instances, which shares a
              >single instance
              >of javax.jms.XAQueueConnection. The aknowledge-mode for B is "Auto-aknowledge".
              >
              >We're using Weblogic Server 6.1.3.0 / Red Hat Linux 7.3.
              >
              >Any help on this problem is appreciated!
              >
              

  • How to stop and start MDBs to listen for JMS messages

    Hello! This might be more of an architecture question rather than a technical questing, but I post it here, in the lack of a better place...
    For several years I have been using Webster and Webster MQ to send messages back and forth to clients. The architecture for the middleware platform has been designed around the functionality of ListenerPorts. Listenerports is a Webster functionality that let you "stop" and start to listen to JMS messages for a given MDB either by admin console, or by JMX.
    The arhitecture we used was something like this :
    1.Client sends a persistent message to a queue. (order)
    2. An MDB pics up the order message, calls a SessionBean that "fronts" the IIOP back end system.
    This is quite "out of the box" architecture, but we used the Listenerports to solve a stability problem for our back end system.
    The backEnd system was quite unstable, so the EJB threw an exception (typically because of timeout or connection refused) back to the MDB.
    The Listenerport was "defined" to handle 3 errors before stopping, so the MDB resent the message twice before the listenerport automatically stopped. The nice thing about this feature was that the client could continue to send orders, and was not bothered when the back end system was down.
    When the backEnd system was up and running, we could start the listenerport and it was all back to normal state. We even had a start script that checked the state of the listenerport every 30 minute, and started it automatically if it was stopped, making the admin task of starting the MDB unnecessary..
    Now.. Why am I telling this story..
    I would like to know how this could be done using "clean" J2EE technologies..That is..Not using any technology that is not portable..
    I`m playing with glassfish at home, and it struck me that there is nothing in the J2EE spec that defines the functionality described above ? Am i missing something ?
    I Do not want to stop My application because the back end system is down? That is the only way (i know of) that i can "stop" to listen for messages..
    I can put all the messages on an error queue when the backbend system is down, but that would lead to more code just to handle the error messages. Maybe the easiest way to solve this is to "move" (programmatically) all messages from the error queue over to the "standard" queue every XX minute, but somehow that sounds "wrong"
    Can anyone give me some advice to how this problem situation should be solved ? I`m interested in the solution both from an architectural perspective and from a more technical perspective..
    Best regards
    Hans-Jacob Melby

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • What is the recommended way for persisting JMS messages?

    What is the recommended way for persisting JMS messages?. As per the IMQ admin documentation , using the default built-in persistence type which is through unix flat files is much efficient and faster, compared to the database persistence .
    Tried setting up the jdbc stuff for database persistence on iAS 6.5 . I am getting the following
    error .
    [24/Apr/2002:16:09:20 PDT] [B1060]: Loading persistent data...
    [24/Apr/2002:16:09:21 PDT] Using plugged in persistent store: database connection
    url=jdbc:oracle:thin:@dbatool.mygazoo.com:1521:qa1 brokerid=ias01
    [24/Apr/2002:16:09:23 PDT] [B1039]: Broker "jmqbroker" ready.
    [24/Apr/2002:16:11:56 PDT] ERROR [B4012]: Failed to persist interest
    SystemManager%3ASystemManagerEngine%2BiMQ+Destination%0AgetName%28%29%3A%09%09SM_Response%0AClass%3A%09%09%09com.sun.messaging.Topic%0AgetVERSION%28%29%3A%09%092.0%0AisReadonly%28%29%3A%09%09false%0AgetProperties%28%29%3A%09%7BJMQDestinationName%3DSM_Response%2C+JMQDestinationDescription%3DA+Description+for+the+Destination+Object%7D:
    java.sql.SQLException: ORA-01401: inserted value too large for column
    [24/Apr/2002:16:11:56 PDT] WARNING [B2009]: Creation of consumer SM_Response to destination 1
    failed:com.sun.messaging.jmq.jmsserver.util.BrokerException: Failed to persist interest
    SystemManager%3ASystemManagerEngine%2BiMQ+Destination%0AgetName%28%29%3A%09%09SM_Response%0AClass%3A%09%09%09com.sun.messaging.Topic%0AgetVERSION%28%29%3A%09%092.0%0AisReadonly%28%29%3A%09%09false%0AgetProperties%28%29%3A%09%7BJMQDestinationName%3DSM_Response%2C+JMQDestinationDescription%3DA+Description+for+the+Destination+Object%7D:
    java.sql.SQLException: ORA-01401: inserted value too large for column
    Any thoughts?

    From the output, you are using imq 2.0. In that release
    the key used to persist a durable subscriber in the database
    table has a limit of 100 characters. The output shows that
    your value is:
    SystemManager%3ASystemManagerEngine%2BiMQ+Destination%0AgetName%28%29%3A%09%09SM_Res
    ponse%0AClass%3A%09%09%09com.sun.messaging.Topic%0AgetVERSION%28%29%3A%09%092.0%0Ais
    Readonly%28%29%3A%09%09false%0AgetProperties%28%29%3A%09%7BJMQDestinationName%3DSM_R
    esponse%2C+JMQDestinationDescription%3DA+Description+for+the+Destination+Object%7D:
    which is much longer than 100 characters.
    You might want to shorten the string you use for the
    durable name.
    And yes, the default file-based persistence store is
    more efficient when compared to the plugged-in persistence
    through a database.

Maybe you are looking for

  • Vado HD showed a charging icon for a few seconds, but now gone...

    I just received my Vado HD. Could really use some help. Plugged it into the usb cord, saw what looked like a battery meter and a few other things for a second or two, then they went away. The curved red light around the lense is on, but I have no ide

  • OPEN ORDER documents need to be closed.

    Hi All, I need to calulate the Open PO documents. The Open PO document older than 6 months needs to be treated as open and if the PO is satisfy the below requirement then it will consider as close.        Deletion indicator set   or         GR Delive

  • Where are my new ap icons?

    I have downloaded some new apps but they dont show up on the ipad. I can search for them and launch them from the search page but even after syncing they remain invisible - Whats gives? are there only so many pages on the ipad for icons??

  • JSF Validator Lifecycle

    Hi all, I'm planning to check the username and password using jsf validator, however I'm a bit worry about the security when passing the value to the server. Will the value exposed when the validator is called? At first I planned to do some hashing b

  • FMS server buffer delay 5-6 sec live stream ?

    FMS server buffer delay 5-6 sec live stream ?