JMS MDB manual rollback possible ?

Hi,
I want to know if it's possible to manually roll back a message if something goes wrong ?
I have a Message Driven Bean that receives a message and sends it over http to another component. Now I want to make sure that my message isn't lost. So in case of an http timeout I want the message to be put back on the queue in front of following messages.
As I read before, a message is removed from its JMS Queue in case the onMessage method of the bean completes, so in my code
public void onMessage(Message message){
try{
//send message over http
}catch(Exception e){
//this is where I want the message to be roll-backed
As it is now, if there is an http timeout, an axception will be catched, but the onmessage method will still be executed successfully, and the message will be removed from the queue, result, a loss of the message.
is this possible with standard jms ?
kind regards
Bert

It is certainly possible, but it depends on how your application is working.
if you are working with beans: No problem, just set the MessageDrivenContext.SetRollBackOnly() -> rolls back the transaction! (in case of Container managed transaction), if you are using your own transactions, simply roll them back your self.
If you are not using beans, you simply do not acknowledge your message, for JMS a message needs to be acknowledged before it assumes that it is delivered. So set your ACK_MODE to CLIENT_ACKNOWLEDGE and in case of an exception do not acknowledge it, otherwise, do acknowledge it.
Since you are using a MDB the first solution should be used in your case.

Similar Messages

  • JMS - MDB, jboss deployment problem

    Hi everybody,
    I'm new to JMS/MDB and have following problem while deploying MDB under JBOSS:
    22:58:47,735 INFO [EjbModule] Deploying MyPublisher
    22:58:47,745 INFO [EjbModule] Deploying topicMessageBean
    22:58:47,795 WARN [StatelessSessionContainer] message-destination 'PhysicalTopic' has no jndi-name in jboss.xml
    22:58:47,845 INFO [ProxyFactory] Bound EJB Home 'MyPublisher' to jndi 'ejb/MyEj
    bReference'
    22:58:47,865 INFO [EJBDeployer] Deployed: file:/D:/DownLoads/ejb/JBoss/jboss-4.
    0.3/jboss-4.0.3/server/default/deploy/simplemessage.jar
    jboss.xml
    <jboss>
    <enterprise-beans>
    <message-driven>
    <ejb-name>topicMessageBean</ejb-name>
    <destination-jndi-name>topic/MyMDBTopic</destination-jndi-name>
    <mdb-connection-factory>
    <jndi-name>jms/MyTopicConnectionFactory</jndi-name>
    </mdb-connection-factory>
    </message-driven>
    <message-destination>
    <message-destination-name>PhysicalTopic</message-destination-name>
    <jndi-name>topic/MyMDBTopic</jndi-name>
    </message-destination>
    <session>
    <ejb-name>MyPublisher</ejb-name>
    <jndi-name>ejb/MyEjbReference</jndi-name>
    <resource-ref>
    <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
    <jndi-name>jms/TopicConnectionFactory</jndi-name>
    <default-resource-principal>
    <name>guest</name>
    <password>guest</password>
    </default-resource-principal>
    </resource-ref>
    </session>
    </enterprise-beans>
    </jboss>
    ejb-jar.xml
    <ejb-jar>
    <display-name>MessageJAR</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>Topic Message Bean</display-name>
    <ejb-name>topicMessageBean</ejb-name>
    <ejb-class>MessageBean</ejb-class>
    <messaging-type>javax.jms.MessageListener</messaging-type>
    <message-selector></message-selector>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <message-destination-link>PhysicalTopic</message-destination-link>
    </message-driven-destination>
    <activation-config>
    <activation-config-property>
    <activation-config-property-name>messageSelector</activation-config-property-name>
    <activation-config-property-value>NewsType = 'Sports' OR NewsType = 'Opinion'</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>subscriptionDurability</activation-config-property-name>
    <activation-config-property-value>NonDurable</activation-config-property-value>
    </activation-config-property>
    </activation-config>
    </message-driven>
    <session>
    <display-name>MyPublisher</display-name>
    <ejb-name>MyPublisher</ejb-name>
    <home>PublisherHome</home>
    <remote>Publisher</remote>
    <ejb-class>PublisherBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <message-destination-ref>
    <!--message-destination-ref-name>topic/TopicName</message-destination-ref-name-->
    <message-destination-ref-name>topic/MyMDBTopic</message-destination-ref-name>
    <message-destination-type>javax.jms.Topic</message-destination-type>
    <message-destination-usage>Produces</message-destination-usage>
    <message-destination-link>PhysicalTopic</message-destination-link>
    </message-destination-ref>
    <security-identity>
    <use-caller-identity/>
    </security-identity>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>topicMessageBean</ejb-name>
    <method-name>onMessage</method-name>
    <method-params>
    <method-param>javax.jms.Message</method-param>
    </method-params>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>MyPublisher</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>publishNews</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <message-destination>
    <message-destination-name>PhysicalTopic</message-destination-name>
    </message-destination>
    </assembly-descriptor>
    </ejb-jar>
    can somebody help???
    Zahid

    Hi,
    if possible, try with "max-bean-in-free-pool=1".
    note: it would be performance impact, as there would be single bean instance.
    Thanks,
    Qumar Hussain

  • Set Message in BPM to System Error - Manual Restart Possible ?

    Hello,
    I'm working on a scenario where two idocs are merged in a BPM. The next step is sending the message in a synchronous RFC (BAPI) to a SAP R/3. Is it possible to set the merged message to the message status 'System Error - Manual Restart Possible' in the SXMB_MONI, when the BAPI returns an Error message?
    When it's not possible, is there an othe possibility to sent the message again, without involving the source system?
    Thanks in advance
    Matthias

    Hi,
    It would be better i think if you use the concept of raising an exception in your response mapping
    please refer:
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    in the response mapping you can check the condition for the responce code from RFC.
    Ranjit

  • How to cancel automatically messages stated 17 (Application error - manual restart possible) in SAP ECC

    Hi people. I need to create a job to cancel automatically the messages with the status 17 (Application error - manual restart possible) in SAP ECC.
    In SXI_MONITOR I can retrieve these messages filtering just for "Application Error". I can cancel them here, however I need for a Job to do it.
    I appreciate your help.
    Regards
    Arturo Santos

    Hi,
    >Is there any way we can make this automatic
    In RWB-Component Montoring-Adapter Engine-Communication Channel Montoring- Select the Adapter- Go to Settings  and  change as per your Business Requirement.
    Regards
    Agasthuri Doss

  • Notifications of XI-mgs in status 'System Error - Manual Restart Possible'

    Dear colleagues,
    I'm using a simple communication channel of type 'GeneratedReceiverChannel_XI' in order to push XML-messages from the intergration engine into the ABAP-Backend using an ABAP server proxy. Many of these messages, however, show an error status in the XI-monitor (Notifications of XI-mgs in status 'System Error - Manual Restart Possible'). The indication of the system error is OK, since the XML-parser correctly detects a character in a field which shall be mapped to a field of type 'DEC' in the ABAP backend.
    Is there any possibility to configure some type of alerting in the ABAP-backend to track especially the appearence of XML-messages in the XI-monitor with status 'System Error'?
    Thanks a lot and kind regards
    Stefan

    HI,
    As its mentioned in above postes, you can configure the Alert notification in XI which can give you the alerts about this kind of errors.
    If the exception is raised after reaching to ABAP backend R/3 Side, then you may trace it in t-code SXMB_MONI of R/3.
    Refer -- ALERT MANAGMENT
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/81023cfa699508e10000000a11402f/content.htm
    Thanks
    Swarup

  • Reservation created automatically. No manual changes possible

    Hi Experts,
    The reservation created automatically for an order can't do any changes and giving an error message as "reservation created automatically. no manual changes possible".
    Kindly help me how to do the changes.
    Thanks & Regards,
    Arul.

    I guess the error message makes it clear you cannot do any manual changes via MB22 or some Z program.
    The only way to change such reservations is to go to the respective order & make the necessary changes to the specific component eg: change of date or quantity etc.
    Hope it clarifies.

  • JMS - MDB

    Hi everybody,
    I'm new to JMS/MDB and have following problem while deploying MDB under JBOSS:
    22:58:47,735 INFO [EjbModule] Deploying MyPublisher
    22:58:47,745 INFO [EjbModule] Deploying topicMessageBean
    22:58:47,795 WARN [StatelessSessionContainer] message-destination 'PhysicalTopic' has no jndi-name in jboss.xml
    22:58:47,845 INFO [ProxyFactory] Bound EJB Home 'MyPublisher' to jndi 'ejb/MyEj
    bReference'
    22:58:47,865 INFO [EJBDeployer] Deployed: file:/D:/DownLoads/ejb/JBoss/jboss-4.
    0.3/jboss-4.0.3/server/default/deploy/simplemessage.jar
    jboss.xml
    <jboss>
    <enterprise-beans>
    <message-driven>
    <ejb-name>topicMessageBean</ejb-name>
    <destination-jndi-name>topic/MyMDBTopic</destination-jndi-name>
    <mdb-connection-factory>
    <jndi-name>jms/MyTopicConnectionFactory</jndi-name>
    </mdb-connection-factory>
    </message-driven>
    <message-destination>
    <message-destination-name>PhysicalTopic</message-destination-name>
    <jndi-name>topic/MyMDBTopic</jndi-name>
    </message-destination>
    <session>
    <ejb-name>MyPublisher</ejb-name>
    <jndi-name>ejb/MyEjbReference</jndi-name>
    <resource-ref>
    <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
    <jndi-name>jms/TopicConnectionFactory</jndi-name>
    <default-resource-principal>
    <name>guest</name>
    <password>guest</password>
    </default-resource-principal>
    </resource-ref>
    </session>
    </enterprise-beans>
    </jboss>
    ejb-jar.xml
    <ejb-jar>
    <display-name>MessageJAR</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>Topic Message Bean</display-name>
    <ejb-name>topicMessageBean</ejb-name>
    <ejb-class>MessageBean</ejb-class>
    <messaging-type>javax.jms.MessageListener</messaging-type>
    <message-selector></message-selector>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <message-destination-link>PhysicalTopic</message-destination-link>
    </message-driven-destination>
    <activation-config>
                        <activation-config-property>
                        <activation-config-property-name>messageSelector</activation-config-property-name>
                        <activation-config-property-value>NewsType = 'Sports' OR NewsType = 'Opinion'</activation-config-property-value>
                        </activation-config-property>
                        <activation-config-property>
                        <activation-config-property-name>subscriptionDurability</activation-config-property-name>
                        <activation-config-property-value>NonDurable</activation-config-property-value>
                        </activation-config-property>
                   </activation-config>
    </message-driven>
    <session>
    <display-name>MyPublisher</display-name>
    <ejb-name>MyPublisher</ejb-name>
    <home>PublisherHome</home>
    <remote>Publisher</remote>
    <ejb-class>PublisherBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
         <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
              <res-type>javax.jms.TopicConnectionFactory</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
         <message-destination-ref>
         <!--message-destination-ref-name>topic/TopicName</message-destination-ref-name-->
              <message-destination-ref-name>topic/MyMDBTopic</message-destination-ref-name>
              <message-destination-type>javax.jms.Topic</message-destination-type>
              <message-destination-usage>Produces</message-destination-usage>
              <message-destination-link>PhysicalTopic</message-destination-link>
         </message-destination-ref>
         <security-identity>
    <use-caller-identity/>
    </security-identity>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
         <container-transaction>
         <method>
              <ejb-name>topicMessageBean</ejb-name>
              <method-name>onMessage</method-name>
              <method-params>
              <method-param>javax.jms.Message</method-param>
              </method-params>
         </method>
         <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
         <method>
              <ejb-name>MyPublisher</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>publishNews</method-name>
         </method>
         <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <message-destination>
         <message-destination-name>PhysicalTopic</message-destination-name>
         </message-destination>
    </assembly-descriptor>
    </ejb-jar>
    can somebody help???
    Zahid

    Thanks for the reply.
    I'm not getting any errors. The MDB doesn't get invoked when a message is sent on the Topic its listening on.
    The deployment descriptors are given below:
    ejb-jar.xml
    <message-driven>
    <ejb-name>PkgMDB</ejb-name>
    <ejb-class>com.pkg.jms.PkgMDB</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    </message-driven-destination>
    </message-driven>
    orion-ejb-jar.xml
    <message-driven-deployment name="PkgMDB"
    destination-location="jms/PkgTopic"
    connection-factory-location="jms/PkgConFactory">
    <resource-ref-mapping name="jms/PkgTopic" />
    <resource-ref-mapping name="jms/PkgConFactory" />
    </message-driven-deployment>
    jms.xml
    <topic name="jms/PkgTopic" location="jms/PkgTopic">
    </topic>
    <topic-connection-factory name="jms/PkgConFactory" location="jms/PkgConFactory">
    </topic-connection-factory>
    web.xml
    <resource-ref>
    <res-ref-name>jms/PkgTopic</res-ref-name>
    <res-type>javax.jms.Topic</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <resource-ref>
    <res-ref-name>jms/PkgConFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Regards
    Ranga

  • How to acknowledge JMS messages manually in BPEL

    How to acknowledge JMS messages manually in BPEL?
    Thanks!

    If Oracle BPEL/SOA Dev team is watching this form then please add this feature as all the major vendors support this.

  • Causing onMessage in MDB to rollback

              Is it possible for a pub/sub MDB to "unconsume" a message? I have successfully
              rolled back a message consumed by a point-to-point MDB, but not one consumed by
              a pub/sub MDB.
              I am using WLS 7.0 and MQ 5.3. My deployment descriptor specifies container management
              and durable subscriber
              The logic for the p2P and pub/sub MDBs is similar. The onMessage rejects every
              other message (based on a static member counter), either via context.setRollbackOnly()
              or throwing an EJBException (I've tried implementing both). For pub/sub, I have
              2 MDBs, the second MDB accepts all messages. In p2p, when a message is rejected,
              it is re-consumed by the next bean that the container instantiates. In pub/sub
              a message that is accepted by bean 1 is also read by bean 2. A message that is
              rejected by bean 1 is read by bean 2, but bean 1 does not retry, indicating that
              the message was not returned to the topic for bean 1.
              Am I missing something, or is it not possible to return a message to a topic once
              a subscribing MDB has retrieved it?
              TIA,
              Ed
              

    One thing is that you are not running transactionally. In order to
              get transactions, "onMessage()" for each MDB needs to be set to
              "Required":
              <assembly-descriptor>
              <container-transaction>
              <method>
              <ejb-name>exampleMessageDrivenA</ejb-name>
              <method-name>onMessage()</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              Ed Trembicki-Guy wrote:
              > Thanks Tom. Here are the descriptor files:
              >
              > ejb-jar.xml:
              >
              > <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
              > 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
              >
              > <!-- Generated XML! -->
              >
              > <ejb-jar>
              > <enterprise-beans>
              > <message-driven>
              > <ejb-name>PTPMsgBean</ejb-name>
              > <ejb-class>com.roxy.ejb.WLMsgBean</ejb-class>
              > <transaction-type>Container</transaction-type>
              > <message-driven-destination>
              > <destination-type>javax.jms.Queue</destination-type>
              > </message-driven-destination>
              >
              > </message-driven>
              > <message-driven>
              > <ejb-name>PubSubMsgBean</ejb-name>
              > <ejb-class>com.roxy.ejb.WLPubSubMsgBean</ejb-class>
              > <transaction-type>Container</transaction-type>
              > <message-driven-destination>
              > <destination-type>javax.jms.Topic</destination-type>
              > <subscription-durability>Durable</subscription-durability>
              > </message-driven-destination>
              >
              > </message-driven>
              > <message-driven>
              > <ejb-name>PubSubMsgBean2</ejb-name>
              > <ejb-class>com.roxy.ejb.WLPubSubMsgBean2</ejb-class>
              > <transaction-type>Container</transaction-type>
              > <message-driven-destination>
              > <destination-type>javax.jms.Topic</destination-type>
              > <subscription-durability>Durable</subscription-durability>
              > </message-driven-destination>
              >
              > </message-driven>
              > </enterprise-beans>
              >
              > </ejb-jar>
              >
              > <?xml version="1.0" encoding="UTF-8"?>
              > <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
              > 'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
              >
              > weblogic-ejb-jar.xml:
              >
              > <!-- Generated XML! -->
              >
              > <weblogic-ejb-jar>
              > <weblogic-enterprise-bean>
              > <ejb-name>PTPMsgBean</ejb-name>
              > <message-driven-descriptor>
              > <pool>
              > <max-beans-in-free-pool>1</max-beans-in-free-pool>
              > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              > </pool>
              >
              > <destination-jndi-name>mqQ</destination-jndi-name>
              > <connection-factory-jndi-name>mqQCF</connection-factory-jndi-name>
              > </message-driven-descriptor>
              >
              > </weblogic-enterprise-bean>
              > <weblogic-enterprise-bean>
              > <ejb-name>PubSubMsgBean</ejb-name>
              > <message-driven-descriptor>
              > <pool>
              > <max-beans-in-free-pool>1</max-beans-in-free-pool>
              > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              > </pool>
              >
              > <destination-jndi-name>mqT</destination-jndi-name>
              > <connection-factory-jndi-name>mqTCF</connection-factory-jndi-name>
              > </message-driven-descriptor>
              >
              > </weblogic-enterprise-bean>
              > <weblogic-enterprise-bean>
              > <ejb-name>PubSubMsgBean2</ejb-name>
              > <message-driven-descriptor>
              > <pool>
              > <max-beans-in-free-pool>1</max-beans-in-free-pool>
              > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              > </pool>
              >
              > <destination-jndi-name>mqT</destination-jndi-name>
              > <connection-factory-jndi-name>mqTCF</connection-factory-jndi-name>
              > </message-driven-descriptor>
              >
              > </weblogic-enterprise-bean>
              > </weblogic-ejb-jar>
              >
              > Tom Barnes <[email protected]> wrote:
              >
              >>Hi Ed,
              >>
              >>It should be possible, but with one caveat: If the
              >>subscriber is non-durable, then a JMS vendor has the option
              >>of simply "forgetting" or "dropping" a message on
              >>a rollback. WL JMS does not do this (we think
              >>this behavior makes nondurable less useful), but
              >>IBM JMS may. Actually, the JMS spec specifically gives
              >>vendors the option of arbitrarily dropping
              >>pub/sub messages to nondurable subscribers for
              >>ANY reason, and a few vendors take advantage of this.
              >>
              >>Anyhow, if you post your descriptor xml files I'll
              >>take a quick look.
              >>
              >>You may want to try a test with WL JMS as the topic
              >>provider to see if that narrows the problem down
              >>to something in MQ or possibly something in the WL
              >>container "foreign vendor" integration code.
              >>
              >>Tom
              >>
              >>Ed Trembicki-Guy wrote:
              >>
              >>
              >>>Is it possible for a pub/sub MDB to "unconsume" a message? I have
              >>
              >>successfully
              >>
              >>>rolled back a message consumed by a point-to-point MDB, but not one
              >>
              >>consumed by
              >>
              >>>a pub/sub MDB.
              >>>
              >>>I am using WLS 7.0 and MQ 5.3. My deployment descriptor specifies
              >>
              >>container management
              >>
              >>>and durable subscriber
              >>>
              >>>The logic for the p2P and pub/sub MDBs is similar. The onMessage rejects
              >>
              >>every
              >>
              >>>other message (based on a static member counter), either via context.setRollbackOnly()
              >>>or throwing an EJBException (I've tried implementing both). For pub/sub,
              >>
              >>I have
              >>
              >>>2 MDBs, the second MDB accepts all messages. In p2p, when a message
              >>
              >>is rejected,
              >>
              >>>it is re-consumed by the next bean that the container instantiates.
              >>
              >>In pub/sub
              >>
              >>>a message that is accepted by bean 1 is also read by bean 2. A message
              >>
              >>that is
              >>
              >>>rejected by bean 1 is read by bean 2, but bean 1 does not retry, indicating
              >>
              >>that
              >>
              >>>the message was not returned to the topic for bean 1.
              >>>
              >>>Am I missing something, or is it not possible to return a message to
              >>
              >>a topic once
              >>
              >>>a subscribing MDB has retrieved it?
              >>>
              >>>TIA,
              >>>Ed
              >>>
              >>
              >
              

  • Container managed transactions in 9.0.3 (plus AQ JMS/MDB)

    Something for "real programmers", similar to MDB Transaction Exception on OC4J 9.0.4 (MDB Transaction Exception on OC4J 9.0.4) but little bit different. Maybe author of the mentioned thread can find some answers here also.
    We have an MDB accessing AQ in database (this works either with 9i and 8i). MDB receives the message (actually TextMessage), retrieves the content/properties and calls some EJBs making database operations. When we used just the same DataSource for JMS resource provider and SQL operations, everything worked OK. But we need to move one step further - making calls to several databases, some 8i, some might 9i. We were able to start CMT for one DataSource, i. e. configuring OrionCMTDataSource over JDBC ORACLE driver (if you use different DataSource class, message remains stucked in queue and eventually expires. If you don't specify container managed transactions for MDB in ejb-jar.xml, it works with any DataSource class - but message is lost every time exception occurs - not very pleasant situation).
    We are trying to configure DataSources so they provide transactional support while using commit coordinator. There are some documents describing this - in 9iAS Data Sources and JTA, Orion Data Sources and possibly JTA description in 9i database documentation. Both ORACLE documents are very similar. Generally, these are main steps:
    1) configure each data source so they provides CMT support (wrap native driver/data source by OrionCMTDataSource class)
    2) create datasource commit-coordinator database, also using CMT(?)
    3) create user in commit-coordinator database and same in each other database with connect, resource, create session + force any transaction priviledge (since it would commit other users transactions)
    4) create database links from commit-coordinator database to each databases (but... see questions below)
    5) configure commit coordinator so it uses proper data source
    6) add each DB link as a property to data sources
    7) configure data source for JMS
    8) connect JMS resource provider with JMS data source
    9) Start container, send message, etc.
    So far the only result we've got is a trace file in database user dumps and generic "javax.transaction.SystemExeption: Could not commit: error code 29540". User dump occurs in a "remote" database, not the one where commit coordinator resides. If I drop database links, result is the same, so it seems like problem with data source itself. In a dump there is piece of text like this: "FATAL ERROR IN TWO-TASK SERVER: error = 12571" and "ksedmp: internal or fatal error
    Current SQL statement for this session:
    begin dbms_aqin.aq$_dequeue_in( :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29); end; ". I think AQ call is just a coincidence since it is the first one involved in transactions. Down there in HEX part of a dump there is a message about protocol or network error ("probably ORA-28546")
    Here is an example of data source configuration we are using:
    <!-- Passport CMT DataSource -->
    <data-source
    name="PassportDS"
    class="com.evermind.sql.OrionCMTDataSource"
    location="jdbc/PassportDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="int"
    password="int"
    url="jdbc:oracle:thin:@ws18885:1521:ICON"
    inactivity-timeout="30">
    <property name="dblink" value="ICON.WS18885.APPG.COM"/>
    There are some questions pending. Obvious one is if CMT is working or not at all and we should find some different solution (Bean managed transactions or use XA, hmmm). Other one might be that database link has to be "fully-qualified". I'm not sure what it means: using username and password? Using database name along with domain (if any)? So far it seems links are not used anyway.
    We've tried several databases, like 9.2.0.1 and 9.0.3 versions. Result is the same.
    We've tried to use XA data source of ORACLE (oracle.jdbc.xa.client.OracleXADataSource) and OrionCMT data source bound by xa-source-location to it but container gets stucked upon restart with "Investingating resource 'XADataSource PassportXADS' for recovery..." and similar messages for an hour.
    There is an OracleJTADataSource mentioned in several documents, but I cannot find any in jdbc classes - was it deprecated?
    Lies the problem in JMS itself? So far we've been able to use AQ in 8i and 9i and succesfully commit every transaction - provided transaction was local.
    Since XA itself is working I guess problem might be with configuration.
    I will appreciate any opinion on CMT... also, if you have any questions, please ask.
    Myrra

    Hi Per,
    I don't have an answer for you -- sorry {:-( -- only a suggestion (which
    you may have already tried, anyway :-). Have you tried running OC4J
    in "debug" mode? The following web-page gives details on how to do that:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    Also, if you aren't already aware of them, the following web-sites
    may also be helpful (not in any particular order):
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

  • Reg MDB transaction rollback

    i have an MDB deployed on weblogic 8.1 sp6 server. My confusion here is how the MDB handles transaction rollbacks. E.g suppose if the MDB is designed to do the below action.
    1) read an xml message from a jms queue
    2) insert some database records
    3) generate some xml message, post it to some other jms queue
    suppose if step 1 and 2 is completed, and its on step 3, at this point weblogic server shutdowns suddenly, once i restart the server, it reads the xml message again from the jms queue, but this time it errors out, because it finds the data already entered in step 2.
    My question is when the weblogic server shut down while the mdb was at step 3, why didnt it removed all the db entries it made in step 2. This behaviour apears to me as partial rollback. I have given the mdb descriptor below.
    <ejb-jar>
      <enterprise-beans>
        <message-driven>
          <ejb-name>CSS_Response</ejb-name>
          <ejb-class>com.bt.neo.core.utility.appcontroller.transport.mdb.JmsMessageReceiver</ejb-class>
          <transaction-type>Container</transaction-type>
          <acknowledge-mode>auto-acknowledge</acknowledge-mode>
          <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
          </message-driven-destination>
          <env-entry>
            <env-entry-name>ejb/BeanFactoryPath</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>core-css-response-inbound.xml</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>ProcessorBeanName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>transportAdaptor</env-entry-value>
          </env-entry>
          <resource-ref>
            <res-ref-name>jms/faultTo</res-ref-name>
            <res-type>javax.jms.Destination</res-type>
            <res-auth>Container</res-auth>
          </resource-ref>
        </message-driven>
      </enterprise-beans>
      <assembly-descriptor>
        <container-transaction>
          <method>
            <ejb-name>CSS_Response</ejb-name>
            <method-name>onMessage</method-name>
            <method-params>
              <method-param>javax.jms.Message</method-param>
            </method-params>
          </method>
          <trans-attribute>Required</trans-attribute>
        </container-transaction>
      </assembly-descriptor>
    </ejb-jar>Please clear my doubt.
    Edited by: Deepak Dev on 19-Dec-2011 11:01

    General information on message-driven beans can be found here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html
    To transaction configuration is discussed here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html#wp1162058
    Looks like you have to set the transaction-type to Container and the trans-attribute to required. Also see the note:
    - However, if you make this configuration error, the MDB will not run transactionally—if a failure occurs mid-transaction, updates that occurred prior to the failure will not be rolled back.

  • JMS, MDBs, XA and JConsole's 'Threads Started'

    Hi,
    I'm currently looking at perforamce issues of an MDB based application running in SJSAS 8.2. While monitoring the performance of the application we have noticed that the number of threads started (as reported by jconsole) matches the number of messages submitted the the system times the number of MDBs that the message passes through i.e. if we create 20,000 messages and the each processed by 5 MDBs we see the number of threads started rise by 100,000. Each MDB updates a database and passes the message onto another JMS queue in an XA transaction.
    As the number of live threads and peak threads stays pretty constant through out the processing (approx. 150) is this to be expected or is it something that requires more investigation?
    Thanks
    Stephen

    In SJSAS 8.2, the MDB container spawns a new thread to handle each message on the queue. The thread should be short-lived (only as long as it takes to run the onMessage method), but you could certainly see the type of build-up you're describing.
    In SJSAS 9.x, the MDBs are handed by the thread-pool-1 threadpool in your domain.xml, which will be more efficient. So if its possible to upgrade, that would take care of your issue.

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • JMS - PI - IDoc scenario: possible to disable check for duplicate JMS message ID?

    Dear all,
    we have a scenario JMS - PI - IDoc. We are on 7.4 SP 7 AEX.
    Once and again we get this error in PI Logs
    com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(MessageFilterContext filterCtx)
    Duplicated and already processed JMS message with JMSMessageID ID:414d512053415050523120202020202053f0f4852000fb39 and XI message id b0beffdbcee64c2605779eaacf27b335 detected.
    We are currently investigating the error and it seems that the duplicate message IDs already exist on the JMS (MQ) side. The messages with the same ID reside in the same queue but have different payloads, so really are different messages
    While it's certainly true that we need to get rid of those duplicate IDs in the long run, I'd like to ask if it is possible to tackle the problem from both sides.
    My sender JMS Adapter looks like this:
    Transactional JMS Session = Checked
    Set PI Message ID (MessageID) to = GUID
    Set PI conversation ID (ConversationID) to = No Value
    Enable Duplicate Handling = Unchecked
    Prefix Channel ID = Unchecked
    --> Is there any way to tell PI to just ignore the duplicate JMS ID and continue processing?
    Many thanks
    Kind regards
    Jens

    Hi Jens - Please have a look at the below note if it helps.
    If you want the duplicate messages received from different channels (that is JMS Messages with the same Message ID) to be processed as a distinct JMS messages and not as duplicate messages, select Prefix Channel ID to JMS Message ID
    Reference :
    Configuring the Sender JMS Adapter - Advanced Adapter Engine - SAP Library

  • JMS/MDB : message synch problem

    We have a WL 8.1 FIFO based queue to which are attached a bunch of MDBs. These MDBs pull messages out of the queue, does some processing and put messages in another queue.
    We would like to get the messages in the second queue in the same order in which they were picked up from the first queue.
    But because the processing time is slightly different for each type of messages, sometimes some messages jump ahead of another one that was picked up earlier.
    We are free to introduce other queues, or to use bridges etc. Can somebody suggest a solution.
    ( something like using destination key )
    Thanks
    --sony                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    if possible, try with "max-bean-in-free-pool=1".
    note: it would be performance impact, as there would be single bean instance.
    Thanks,
    Qumar Hussain

Maybe you are looking for