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"/>
          >
          

Similar Messages

  • 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?

  • 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

  • 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

  • MDB and Singleton

    I have a MDB that receives data from a JSM queue in XML format. After converting the XML to proper Value Objects using JAXB, it calls a DAO.
    We have configure the App server (WLS 8.1)to have 10 MDB in the pool.
    The DAO is a singleton with a none static private data member that holds the DataSource.
    The DAO.add() operation gets connection from the data source and performs the add.
    When we put one msg on the JMS queue we see the transaction time in DAO.add() is an about 1 sec.
    When we put 30 msgs on the JMS queue we see 10 threads accessing the singleton instance of the DAO.
    I was hoping to see the DB transactions started by these 10 threads would be executed in parallel they way threaded operations should behave considering the context switching factor however what I am seeing from the log files is that the DB transactions are serialized meaning they get executed one at a time!!?? Therefore it takes 10 sec for the 10 threads to complete their work. I was expecting to see something like 3 to 4 sec for all 10 thread to complete the add operation.
    Anyone has any ideas? Could it be that the Datasource is a private member of the Singleton DAO and each thread who calls the DAO.add() gets queued up to get access to the Data Source?
    Any idea would be great.
    Thanks.

    Thanks for your answer,
    So you never load classes then from configuration file? For example lets say you are processing xml message and for each xml message tag name you have in configuration file the appropriate class to handle such a message. Instead of configuration files would you then just store the values in a map of messageTagName to JNDI name?
    Thanks
    http://www.ellasweddingfavors.com
    Message was edited by:
    fkzeljo
    Ellas Wedding Favors

  • MDB and "stuck" messages

    Hi,
    We're developing a MDB listening to a AQ/JMS database persistant queue, on a Oracle JMS provider.That MDB as to be bullet proof (no lost messages), and that's why we're using database persistance.So far everything is working fine, but we have one issue that cause some headackes.
    For what I know, the onMessage() method doesn't acknowledge to the provider until the method completes, without trowing an exception. In that case, the provider rollback so he can try to redeliver the message again. Since we have some important processing done within the onMessage() method, we were worried about what would happen if the MDB crash (java code crash, server crash, sledgehammer hit). I tryed to read that message via a java class I wrote, but I couldn't. (i guess the message is still waiting for the acknowledge)
    So to make it short, I placed a "thread.Sleep" in the middle of the onMessage() method, I deployed it on my application server, put a message in the queue, and I pressed the reset button of my machine. The result was that the message was still in the queue (that's nice since we didn't lost it), but never redelivered, and after some time (like 12h), the message was gone of the database and not delivered. (the message expiration was set to 0)
    So the big question would be: what happen to a JMS message if the MDB crash for any reason and what's the behavior of the JMS provider, and if there's anything we can do to redeliver that "stuck" message?
    I guess the provider keep the status of each message somewhere in the database (something that says to him that the message is in develery, waiting for acknowledge).
    Thanks

    Most likely this is some server configuration issue and not an actual programming problem (because as you say yourself, on another system it works). I can advise only two things.
    - dig through the weblogic documentation
    - take your question to the weblogic forum
    https://forums.oracle.com/forums/category.jspa?categoryID=193

  • 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 :-)

  • 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!!

Maybe you are looking for

  • USB Live! Sound Blaster 24bit with poppi

    Hi. A month or two ago I purchased my usb connected Li've! Sound Blaster 24bit from CompUSA. It has worked fine with my logitech 5. speakers. Yesterday, I bought a 60gig Maxtor harddri've from compusa, also USB. Since I installed that, my sound has b

  • Adobe Flash Player 10 Problem.

    Alright everyone, this issue has been bugging me for so damn LONG!!!!! The problem is: I'm trying to make my Adobe Flash Player 10 to work in my Mozilla Firefox because a certain website is asking for my flash player to get updated to 10. I've both i

  • User id is not processed by BAPI

    Hi , We are implementing SAP PM and developing interface with PI. Iam passing userid (technicians) to BAPI for  Dismantling/Installation of equipment as to track who has performed the action. The issue is PI is not taking the userid rather it is proc

  • Mouseclicking a character places caret differently in Java6

    Clicking a character in a JTextField or JTextArea can result in a different caret position in Java6 than in Java5. With the letters 'dog' in the field, click the mouse on the arc at the left edge of the d. Now try clicking it at the right edge near t

  • Flash player opens new windows constantly

    Hi, this week my adobe flash started to open separately from my browser. When I try to play a game or watch a video it opens the game/video outside the browser page. I've already tried to uninstall it and install it again but the problem keeps happen