MDB and Trasactions dilemma.

OK, I've got this MDB that gets messages off of Queue A, does some work and then sends a response to Queue B, where something is listening.
This work flow works very well for me.
What happens when something goes wrong? I'm using container managed transactioning so if I get a runtime exception the container puts the message back on the queue and reties a few times. After those few tries the container gives up and and throws a System Exception.
Here's the problem...how do I send something to my response queue to tell my waiitng app that the transaction failed. I can't use timeouts on the listener side b/c I have no idea how long these processes could take when working correctly.
HELP :-)

OK, I've got this MDB that gets messages off of Queue A, does some work and then sends a response to Queue B, where something is listening.
This work flow works very well for me.
What happens when something goes wrong? I'm using container managed transactioning so if I get a runtime exception the container puts the message back on the queue and reties a few times. After those few tries the container gives up and and throws a System Exception.
Here's the problem...how do I send something to my response queue to tell my waiitng app that the transaction failed. I can't use timeouts on the listener side b/c I have no idea how long these processes could take when working correctly.
HELP :-)

Similar Messages

  • MDB and Trasaction problems...well sort of

    OK, I've got this MDB that gets messages off of Queue A, does some work and then sends a response to Queue B, where something is listening.
    This work flow works very well for me.
    What happens when something goes wrong? I'm using container managed transactioning so if I get a runtime exception the container puts the message back on the queue and reties a few times. After those few tries the container gives up and and throws a System Exception.
    Here's the problem...how do I send something to my response queue to tell my waiitng app that the transaction failed. I can't use timeouts on the listener side b/c I have no idea how long these processes could take when working correctly.
    HELP :-)

    If anyone who has anything to add to this scenario...please do!!

  • EJB 3.0 MDB and transactions

    I'm trying to use an XA topic connection factory in my MDB, I was getting a "not supported in this release" error until I added this annotation to my MDB:
    @MessageDrivenDeployment(
    resourceAdapter = "myProviderInstance"
    But now my MDB is no longer dequeuing messages.
    I found the following in the docs (http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28221/undejdev010.htm#CCHGGHAE)
    --- BEGIN QUOTE FROM ORACLE DOCS ---
    If you use @MessageDrivenDeployment, you can configure message service options using nested @ActivationConfigProperty annotations or using @MessageDrivenDeployment attributes: @ActivationConfigProperty configuration overrides @MessageDrivenDeployment attributes.
    If you use @MessageDriven, you can configure message service options using nested @ActivationConfigProperty annotations only.
    If you configure using @MessageDrivenDeployment attributes, your application can only access a message service provider without a J2CA resource adapter. If later you decide to access your message service provider using a J2CA resource adapter, your application will fail to deploy. If you configure using nested @ActivationConfigProperty annotations, your application can access a message service provider with or without a J2CA resource adapter. Oracle recommends that if you configure using annotations, you should use the @ActivationConfigProperty approach.
    Example 2-6 shows both a @MessageDrivenDeployment and @MessageDriven annotation using @ActivationConfigProperty annotations for message service configuration. Note that the DestinationName activation configuration property in the @MessageDrivenDeployment annotation overrides that in the @MessageDriven annotation.
    Example 2-6 @MessageDriven and @MessageDrivenDeployment Annotation for a J2CA Message Service Provider
    import javax.ejb.MessageDriven;
    import oracle.j2ee.ejb.MessageDrivenDeployment;
    import javax.ejb.ActivationConfigProperty;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(
    activationConfig = {
    @ActivationConfigProperty(
    propertyName="DestinationName", propertyValue="OracleASjms/MyQueue"
    @MessageDrivenDeployment(
    activationConfig = {
    @ActivationConfigProperty(
    propertyName="DestinationName", propertyValue="OracleASjms/DeployedQueue"
    @ActivationConfigProperty(
    propertyName="ResourceAdapter", propertyValue="OracleASjms"
    --- END QUOTE FROM ORACLE DOCS ---
    So, instead of specifying the resource adapter as I had above, I simply pasted the last bit of annotations from the docs into my MDB, and much to my surprise I learned that you can't have an activationConfig in a @MessageDrivenDeployment
    What's the solution?

    OK, I got a little further. Everything works now as such
    I'm using the XA topic connection factory, I'm using the resource adapter.
    BUT, when I set the transaction required attribute on the MDB, I no longer receive messages.
    No errors are logged anywhere. Any suggestions?

  • Where we can use standard ODS Object and Trasactional ODS Object ?

    Where we can use standard ODS Object and Trasactional ODS Object ?

    Hi,
    In a standard ODS object, data is stored in different versions (active, delta, modified), whereas a transactional ODS object contains the data in a single version.  Therefore, data is stored in precisely the same form in which it was written to the transactional ODS object by the application. In BW, you can use a transaction ODS object as a data target for an analysis process. The transactional ODS object is also required by diverse applications, such as SAP Strategic Enterprise Management (SEM) for example, as well as other external applications.Transactional ODS objects allow data to be available quickly. The data from this kind of ODS object is accessed transactionally, that is, data is written to the ODS object (possibly by several users at the same time) and reread as soon as possible.
    It offers no replacement for the standard ODS object. Instead, an additional function displays those that can be used for special applications.
    Regards,
    R.Ravi

  • MDB and JMS on different servers

    Hi,
    My MDB is deployed on a different domain from the JMS server. Both are on weblogic.
    While deploying weblogic, I m getting an error: Unable to create a connection.
    Can anyone give pointers?
    I have ensured the following:
    1. The JMS server starts before the MDB server
    2. The following data is mentioned in weblogic-ejb-jar.xml:
    jndi name of the remote queue
    provider url--- t3://hostName:port
    jndi name of the remote connection factory
    is there anyting else that i m missing ?
    thanx and regards
    Shivraman Giri

    Hi,
    Thanx for responding.
    I will keep in mind these points when I use a foreign JMS provider. T
    Right now I m getting problem when the JMS provider is remote but native ie. MDB and JMS are both on Weblogic. This obviates the need to mention Initial Context. Only the provider URL is to be specified.
    Can you suggest a reason as to why i my EJB container (first weblogic ) is unable to connect to JMS provider (another weblogic)
    regards
    S.G

  • Creating a MDB and Distributed Queue in Clustered env in weblogic 9.2

    I have created 3 managed servers and all these managed servers are in the cluster.
              Now i create JMS module for this cluster and create the Connection factory 'QUEUE_CF_8' and distributed Queue 'DIS_QUEUE_8' targeting to the cluster.
              I create a MDB and JMS client and deploy them in the cluster.JMS client sends the message to the distributed queue and MDB is listening to the distributed queue
              When i deploy the MDB , it is deploys perfectly . But when i run the client it fails with the following exception
              [java] javax.naming.NameNotFoundException: Unable to resolve 'QUEUE_CF_8'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'QUEUE_CF_8'. Resolved '']; remaining name 'QUEUE_CF_8'
              When i view the JNDI tree for all the managed servers , i can see the Connection factory and the distributed queue.
              Also i deploy the MDB to the cluster and no submoduletargets are specified.
              Let me know what is that iam missing.

    <?xml version='1.0' encoding='UTF-8'?>
              <weblogic-jms xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
              <connection-factory name="Queue_CF_8">
              <sub-deployment-name>Server_group_4</sub-deployment-name>
              <jndi-name>QUEUE_CF_8</jndi-name>
              <security-params>
              <attach-jmsx-user-id>false</attach-jmsx-user-id>
              </security-params>
              </connection-factory>
              <uniform-distributed-queue name="DIS_QUEUE_8">
              <sub-deployment-name>Server_group_4</sub-deployment-name>
              <jndi-name>DIS_QUEUE_8</jndi-name>
              <load-balancing-policy>Round-Robin</load-balancing-policy>
              </uniform-distributed-queue>
              </weblogic-jms>
              But the problem was with the clustering.
              Thanks for your time..

  • Can I recover a damaged SQL Server 2008 database with the undamaged .mdb and .ldf files?

    Their original SQL Server was 2008, with SP unknown, but installed on D: and C: drives.  The power spike corrupted their O/S on the C:
    drive and someone reinstalled both the O/S and the SQL Server, which is now SQL 2008, SP4.  They have intact files for all system databases, both .mdb and .ldf.  Is there some way they can reconnect with the user databases using the intact copies
    of the previous system databases? I have heard that if the SQL Server is stopped, previous Master and Msdb .mdb and .ldf files moved into place and the server restarted, that any previous user database .mdb and .ldf files can be accessed by the SQL server.
    Is this the case, or are there details missing?

    Hello! try this steps
     1 Open your SQL Server Management Studio console. This application shortcut is available in the SQL Server directory in the Windows Start button.
    2  Enter the system administrator user name and password. SQL Server's administrator user name is "sa." This account is required for privileges to restore the database. If your restoring on a host provider server, use the administrator user name
    and password they supplied for your account.
     3 Right-click your database name and select "Attach." In the new window that opens, click the "Add" button to open a dialog box.
     4 Select your MDF file and press the "Ok" button. It may take several minutes to restore the database if it is a large file. Once the process is finished, browse your tables to verify the data. The database is now restored.
    If nothing helped try to use: 
    https://www.youtube.com/watch?v=1cbOYdvBW2c

  • .dat, .mdb and .mpa files

    I had to replace my Palm Pre and am trying to re-poplulate my Motion Apps Classic files.  My Palm OS files were saved online (Carbonite) and when I go into Carbonite to retrieve my Memo files, they are saved as .dat, .mdb and .mpa files.  Can these files a. be imported back into Palm OS, and b. can they be converted to .pdb files?
    Thanks
    Post relates to: Centro (Sprint)

    Anand_JAS wrote:
    I have the audio and video files extracted from .TS file and stored as
    .mpv for video and
    .mpa for audio
    now i need to merge both files.
    finally need to store it as single file like .mpg or some other extention
    Please help me regarding this.
    Thanks in advance...You use a video editing tool that has this capacity.
    - captain obvious

  • MDBs and Transactions.

    Ok,
    I am bit confused with how exactly MDBs work with Transactions.
    For example,
    suppose we have a simple standalone java message producer which sends a message to a Queue. A MDB's onMessage() picks it up.
    Let's say the MDB makes some updates to the database and then invokes a method on a stateless session bean which also updates a database.
    By default the transaction attribute of the MDB and stateless session bean would be REQUIRED.
    If the stateless session bean database update fails, I presume the MDB's database updates also get rolled back.
    But, does the message get rolled back? If not when would the message be rolled back?
    Does it make any difference if the MDB is a topic or a queue? Does it make any difference if the message producer is a standalone client or
    a stateless session bean with it's own transactional behaviour?
    Any help appreciated.
    Thanks.

    The general principle is: if you have a MDB which consumes a message in a transaction, and that transaction is rolled back, then the message is "rolled back". This means that it is put back on the queue or topic. It will then be delivered to the MDB again.
    If your MDB calls a session bean then the two can share the same global transaction as you suggest.
    Note however that the transaction which consumes the message is completely separate from any transaction which placed the message on the queue in the first place. JMS completely decouples the two steps. Once the message is added to the queue the producer is irrelevant.
    Nigel

  • Problems with an MDB and OJMS

    I have a problem with MDBs and OJMS/AQ. onMessage() method fires well when a message is enqueued, but it is never dequeued. Messages are well received by MDB, but they remain on AQ table without dequeue. Can anybody help me? Thanks

    This is bug: Contaner managed transactions do not work with MDBs in OC4J 9.0.3. Either switch to BMT, or use the 10.0.3 preview on OTN.
    The bug is fixed in the 9.0.4 production version which is expected "real soon now".
    HTH
    -Doug

  • Problem: MDB and transactiontimeout

    Hi,
    I have got the following situation.
    I have an XML which is converted in business objects and than those object, one after another, are used to call a session bean which writes them into a DB. Thatt whole process takes to long to take place in one transaction so I have the following solution.
    MDB1 takes the XML and converts it into to those business objects and sends one object after another to MDB2.
    I thought that each call of MDB2 results into a new transaction wich would have enough time to process the message but I get an org.omg.CORBA.TRANSACTION_ROLLEDBACK
    For each MDB I use container managed trasaction.
    Could please someone help me?
    Thanks!

    Check your J2EE app server documentation to see whether you can extend the transaction timeout.
    Here's how in WebLogic 8.1
    http://e-docs.bea.com/wls/docs81/jta/trxejb.html#1040567

  • MDB and XA

     

              Thanks for your help Tom,
              It turns out I didn't have a transaction. Took a while to track it down...thanks
              again...
              Tom Barnes <[email protected]> wrote:
              >Hi Allen,
              >
              >Your JDBC configuration looks correct, but I may be wrong. I suggest
              >posting to the JDBC newsgroup for confirmation. It might be
              >helpful if you post your MDB xml descriptors.
              >
              >Is your JDBC call embedded directly in the MDB, or does the MDB invoke
              >it through another EJB or RMI class?
              >
              >It seems like there may be no transaction even though you set required?
              >To see if the current thread is infected with a live transaction, you
              >can insert some trace code:
              >Call weblogic.transaction.TxHelper.getTransaction() to get the current
              >transaction, then call weblogic.transaction.Transaction.getStatusAsString()
              >to
              >see its status.
              >
              >
              >Tom
              >
              >Allen Miller wrote:
              >
              >> I have a transaction 'required' mdb that essentially instantiates a
              >class that
              >> does database updates. I get the exception below. It appears the database
              >operations
              >> are not running as part of the mdb's transaction.
              >>
              >> I've configured the weblogic supplied oracle xa driver and tx datasourse
              >per the
              >> doc (as I understand it). The code snippet retrieving the datasource
              >and the config.xml
              >> definitions follow the exception message below.
              >>
              >> weblogic 6.1 on win2000
              >>
              >> any ideas???
              >>
              >> 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().
              >>
              >> Context ctx = new InitialContext();
              >> javax.sql.DataSource ds = (javax.sql.DataSource)
              >ctx.lookup ("jdbc/" + "ListenPointReporterConnectionsDs");
              >> return ds.getConnection();
              >>
              >> <JDBCConnectionPool CapacityIncrement="1"
              >> DriverName="weblogic.jdbc.oci.xa.XADataSource"
              >> InitialCapacity="2" LoginDelaySeconds="1" MaxCapacity="15"
              >> Name="PlatformListenPointReporterConnections"
              >> Properties="user=allen;password=allen;dataSourceName=PlatformListenPointReporterConnections;server=alcatraz;serverName=alcatraz"
              >> ShrinkPeriodMinutes="30" ShrinkingEnabled="true"
              >> Targets="listenpointServer" TestConnectionsOnRelease="true"
              >> TestConnectionsOnReserve="true" TestTableName="LP_USER_V"/>
              >>
              >> <JDBCTxDataSource EnableTwoPhaseCommit="true"
              >> JNDIName="jdbc/ListenPointReporterConnectionsDs"
              >> Name="ListenPointReporterConnectionsDs"
              >> PoolName="PlatformListenPointReporterConnections" Targets="listenpointServer"/>
              >
              

  • MDB and transactions

    Hello,
    I was wondering if anyone else has experienced this problem and/or can suggest a solution...btw, I'm running this on JRun4.
    I have a JMS queue that uses a database for the queue. The onMessage method for my MDB is part of a container managed transaction. My onMessage method simply inserts the message into an audit table. I then purposely change the name of the audit table so that my MDB will throw a SQLException.
    If I send a single message, a SQL exception is thrown and caught and I roll back the transaction via MessageDrivenContext.setRollbackOnly(). The stdout logs show that after the exception the transaction is rolled back and the message is resent. This sequence occurs repeatedly until I fix the column name and then the message is consumed and inserted in my audit table. This works as I expect.
    If I were to send 2 (or more) messages, the same SQL exception occurs for each message and the transaction is rolled back and the message(s) are resent. However, once I fix the table error, I find that those 2 messages were repeatedly consumed and inserted into the audit table (e.g. there were 50+ inserts). In the stdout logs it appears once the database problem is corrected each transaction that was rolled back now ends up commiting leading to repeat consumptions.
    Has anyone encountered this? I'm a bit confused as to why, since the rollbacks, resends, and commits appear to work fine when there is only a single message.
    Any suggestions? Thanks.

    This is only a guess, but I'd say that the implementation isn't using two-phase commit aware resources (XAResources) to coordinate modifications to the backend database table. If you're only using a single resource (message in your case) then it's fine to use raw JDBC and turn auto-commit off; the application or container can then use the JDBC driver commit or rollback operations to make the change to the table happen (or not). If you're doing multiple updates through the same JDBC driver within the same global transaction then this still works.
    I wonder if the implementation is somehow adding each message through a separate JDBC instance (even though to the same back end DM) and committing each prior to doing work on the next message. This commit may not be explicit. You may not even know it is going on: for example, if the back end db is Oracle, if you do a close on a JDBC connection which is running in a transaction then it will implicitly commit the transaction at that point.
    For instance:
    receive message
    get JDBC connection
    add message to table
    close JDBC connection (may be explicit or may be implicit via the container)
    <-- commit happens here in some cases
    receive message
    get JDBC connection
    add message to table
    What the implementation really should use is XADataSources and XAConnections to get XAResources that coordinate updates to the database. Or, make sure the same JDBC connection is used within the same transaction. This is more difficult to coordinate because of close.

  • MDB and Database - Listener port stops working

    Hi,
    I have created an MDB which does the following when a message is received from the queue.
    1. Store message in database
    2. do some processing
    At step 1, if there is any issue with the database connection (e.g. database is not available etc), I rollback transaction. My idea is to leave the message on queue for now and retry it again after some time unless the database is back again. "Maximum retries" of the listener port is set to N but since there is no retry interval available, all N retries are done in a flash and my listener port stops working. I cannot use backout mechanism as I have to wait for the database to be back again. What are my options?

    usmanchaudhry wrote:
    Hi,
    I have created an MDB which does the following when a message is received from the queue.
    1. Store message in database
    2. do some processing
    At step 1, if there is any issue with the database connection (e.g. database is not available etc), I rollback transaction. My idea is to leave the message on queue for now and retry it again after some time unless the database is back again. "Maximum retries" of the listener port is set to N but since there is no retry interval available, all N retries are done in a flash and my listener port stops working. I cannot use backout mechanism as I have to wait for the database to be back again. What are my options?i believe you need an XA driver and a transaction manager, for starters.
    a simple JDBC rollback won't do it.
    which app server are you using?
    which jms provider?
    %

  • MDB and EJB in transactions

    Hi ,
              I have an MDB running on weblogic 8.2 and calling a remove ejb running on a different machine. After getting home interface when I tried to create the remote object Iam getting the following error.
              java.lang.NullPointerException
              at weblogic.transaction.internal.PropagationContext.useNewMethod(PropagationContext.java:866)
              at weblogic.transaction.internal.PropagationContext.writeExternal(PropagationContext.java:169)
              at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:100)
              at weblogic.common.internal.ChunkedObjectOutputStream.writeObjectWL(ChunkedObjectOutputStream.java:122)
              at weblogic.rjvm.MsgAbbrevOutputStream.setTxContext(MsgAbbrevOutputStream.java:122)
              at weblogic.rjvm.BasicOutboundRequest.setTxContext(BasicOutboundRequest.java:156)
              at weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:106)
              at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:276)
              at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
              Can any body tell what could be the reason. The message sent from MDB to ejb is a transactional message.
              Thanks in advance
              Manikyala

    I suggest posting to the EJB newsgroup.
              (1) Transactions certainly are supported for remote services. This is a common use case.
              (2) Your problem seemed to occur when getting the remote home - but likely would not occur when actually using it. Since I think (not 100% sure) that the action of obtaining the remote home need not be transactional, I previously suggested suspending the transactions, but only for the duration of the call to get the remote home.
              Tom
              > Hi Tom,
              >
              > Looks like what Iam doing is not correct.
              >
              > Iam calling a remote ejb which on a different server
              > from my MDB. Iam using t3 to get the context. Also in
              > the weblogic-ejb-jar.xml I put transaction value as
              > Required.
              >
              > Now I replaced that with NotSupported and problem is
              > solved.
              >
              > The conclusion is (if Iam not wrong) when creating a
              > remote home we should not use transactions since the
              > remote service is not participating in transaction.
              >
              > Thanks again Tom
              >
              >
              > Manikyala

Maybe you are looking for