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?

Similar Messages

  • 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

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

  • Very simple EJB 3.0 MDB but I get NullPointerException

    I tried to create a very simple EJB 3.0 Message Driven Bean in JDeveloper 10.1.3.2 as follows:
    Message Driven Bean Class:
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(mappedName="MDBQueue")
    public class MDB implements MessageListener {
    public void onMessage(Message message) {
    System.out.println("Got message!");
    Application Client:
    import javax.annotation.Resource;
    import javax.jms.*;
    public class MDBAppClient {
    @Resource(mappedName="MDBQueueConnectionFactory")
    private static QueueConnectionFactory queueCF;
    @Resource(mappedName="MDBQueue")
    private static Queue mdbQueue;
    public static void main(String args[]) {
    try {
    QueueConnection queueCon = queueCF.createQueueConnection();
    QueueSession queueSession = queueCon.createQueueSession
    (false, Session.AUTO_ACKNOWLEDGE);
    QueueSender queueSender = queueSession.createSender(null);
    TextMessage msg = queueSession.createTextMessage("hello");
    queueSender.send(mdbQueue, msg);
    System.out.println("Sent message to MDB");
    queueCon.close();
    } catch(Exception e) {
    e.printStackTrace();
    But I get the following error:
    java.lang.NullPointerException
         at model.MDBAppClient.main(MDBAppClient.java:17)
    I read similar problem in the this thread:
    Re: message driven bean on ejb 3.0 does not work
    some one said that the version in ejb-jar.xml must be changed from 2.1 to 3.0
    but in this case there is no ejb-jar.xml.
    ( I have other cases with ejb-jar.xml file but I can't change the version in ejb-jar.xml)
    the version in web.xml is 2.4 but it not accept any value except 2.4 and an error occur when I tried to change it to 3.0
    please can you tell me why I get NullPointerException and how can I allow EJB 3.0 MDB and JMS to work in JDeveloper

    Note that you can't run MDBs in the embedded OC4J in JDeveloper - try deploying to a stand-alone install of OC4J and see if it works there.

  • 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 Distributed transaction and stored procedure rollback

    Hi All,
    I am developing an asynchronous application using MDB. My application flow is as follows:
    1. From MDB onMessage i am calling another method MEthodA that
    a. calls a simple pojo1 where I am getting a Connection on XA enable datasource1 and executing Stored Procedure1 of DatabaseSchema1. In Stored Procedure1 I have some inner savpoints and rollback. No commit is inside Stored Procedure1 .
    b. In that pojo withput commiting m closing the connection and coming back in MethodA.
    c. Again from MethodA m calling an different pojo2 where I am getting a new Connection on XA enable datasource2 and executing Stored Procedure2 of DatabaseSchema1.In this pojo also without commiting m closing the connection and coming back in MethodA. In Stored Procedure2 I have some inner savpoints and rollback. No commit is inside Stored Procedure2 .
    d. Again from MethodA m calling pojo1 where I am getting a new Connection on XA enable datasource1 and executing a diffrent function of Stored Procedure1 of DatabaseSchema1.
    Now problem is:
    I have written some Savepoint and rollback inside Stored Procedure1 and inside Stored Procedure2. But these rollback is working only in inside Stored Procedure1 not in inside Stored Procedure2 in each case.
    In ejb-jar.xml transaction attributes is Required for all methods and transaction type is Container.
    Backend is Oracle 10g and init.xa has already been run on that.
    I have tested this on Oc4J and Websphere 6.0.
    I am using XaDatasource.
    Will be very obliged if any one can give a single hint of the problem as soon as possible.
    Thanks a lot

    Hi Kent;
      You have a few choices (AFAIK) with ASE...
    1)  AutoCommit = TRUE
      - must be before connect to your DB
    2) End your PB transaction first. For example
    String ls_end    =  "END TRANSACTION"
    String ls_begin  =  "BEGIN TRANSACTION"
    EXECUTE IMMEDIATE  ls_end using SQLCA;
    <call your SP>
    EXECUTE IMMEDIATE  ls_begin using SQLCA;
    3) use a 2nd Transaction Object for the SP where its AutoCommit = TRUE
    - or -
    4) In your SP ...
    Commit Transaction
    begin transaction
        insert into mytab (pub_id) values ("9999")
    commit transaction

  • MDB and EJB

    how can I access the EJB's in a MDB.
    Thank you very much.

    Hi Avi,
    The flow my application was like this
    In HTML screen what ever message entered it will looks for the corresponding web.xml from there it will goes to the corresponding Servlet in that Servlet I am invoking the MDB.
    What ever message entered in the Html screen it is displaying in server console.
    but actually requirement was like this, In HTML screen what ever message entered it will looks for the corresponding web.xml from there it will goes to the corresponding Servlet in that Servlet I am invoking the MDB.from servlet it has to goto the corresponding MDB from there it has go to database .After this it has to print msg on the screen..
    now i want to know how to invoke EJB methods into MDB. We are using oc4j 10.1.3 integrated with Jdeveloper.
    Thanks in advance...
    regards,
    Srini.

  • Weblogic: problem with JMS foreign server and Transaction

    Hello everyone,
    I am working with an enterprise application with Web Application Server Logic 10.3. L 'application uses the following components:
    1) MDB 2.0
    2) FOREIGN JMS SERVER -> WebSpereMQ
    3) EJB SESSION
    L 'MDB calls the session bean which uses in its ejb-jar.xml using a Wrapper for JMS QueueConnectionFactory with res-ref:
    <resource- ref>
    <res-ref-name> jms / iss / QCFIXP </ res-ref-name>
    <res-auth> Container </ res-auth>
    <res-sharing -scope> Shareable </ res-sharing-scope>
    <resource- ref>
    The MDB is CMT
    <transaction-type> Container </ transaction-type>
    while the session bean is BMT
    <transaction-type> Bean </ transaction-type>
    to call the QCFIXP in its transaction.
    The QCFIXP ii an XA resource
    When there is a rollback operation in SessionBean also in 'MDB
    There 'an operation setRollbackOnly:
    getMessageDrivenContext (). setRollbackOnly ();
    After this operation on the MDB I do a JNDI look up the QueueConnectionFactory but sending the message on a queue I get the following exception:
    javax.jms.JMSException: [JMSPool: 169809] An error occurred while registering the JMS connection with JTA:
    But if not using the "wrapper jms" in the session bean I did not take any exception and the application don' t have any error.
    My doubt is :
    Why if I use the JMS wrapper I get an error javax.jms.JMSException: [JMSPool: 169809] An error occurred while registering the JMS connection with JTA?
    Thanks in advance.
    Michele
    Edited by: user3501731 on 11-mag-2011 3.16

    Hi Tom,
    Thanks very much for your responses and careful analysis you've done.
    Following the source code of the MDB where error occurs.
    Marked In bold the line where the exception is thrown.
         public void onMessage(Message msg) {
    //          Utility.logger(AP.DEBUG, "Partito MDB 2");
              processa(msg);
              protected void processa(Message msg) {
              Utility.logger(
                   AP.DEBUG,
                   "IXPReceiverMDB7.processa(Message msg) partito");
              try {
                   long start = System.currentTimeMillis();
    /*               Utility.logger(
                        AP.DEBUG,
                        "IXPReceiverMDB.processa(Message msg) effettuo lookup");*/
                   ejb = myEjbLocalHome.create();
                   // individuo l'identificativo del messaggio in ricezione
                   String msgid = msg.getJMSMessageID();
                   Utility.logger(
                        AP.DEBUG,
                        "IXPReceiverMDB7.processa(Message msg) elaboro messaggio:"
                             + msgid);
                   String charset = msg.getStringProperty("JMS_IBM_Character_Set");
                   Utility.logger(
                        AP.DEBUG,
                        "IXPReceiverMDB7.processa Charset:" + charset );
                   // invoco il processo di ricezione
                   boolean commitRequested = ejb.processa(ctlReq, encoding, msg);
                   // il valore di ritorno del processo di ricezione identifica o meno
                   // la necessita' di effettuare il rollback dell'intero processo
                   if (!commitRequested) {
                        getMessageDrivenContext().setRollbackOnly();
                   if (ctlReq) {
                        Utility.logger(
                             AP.INFO,
                             "IXPReceiverMDB7.processa(Message msg) spedisco il messaggio pilota del 'cleaning' con JMSCorrelationID = '"
                                  + msgid
                                  + "'");
                        msg.setJMSCorrelationID(msgid);
                        // Viene creata la QueueConnection
                        QueueConnectionFactory factory =
                             JmsFactoryDispenser.getSingleton().getFactory();
                        QueueConnection connection = factory.createQueueConnection();
                        // Viene ottenuta la 'session'
                        QueueSession session =
                             connection.createQueueSession(
                                  false,
                                  Session.AUTO_ACKNOWLEDGE);
                        // spedisco il messaggio sulla coda abbinata al processo di 'cleaning'
                        // della coda di controllo
                        IXPMessageManager msgManager = new IXPMessageManager(session);
                        msgManager.spedisci(msg, AP.PILOTQUEUE, "J", AP.STD_MESSAGE);                    session.close();
                        connection.close();
                   long end = System.currentTimeMillis();
                   Long durata = new Long (end - start);
                   Utility.logger(
                        AP.INFO,
                        "IXPReceiverMDB7 Tempo totale elaborazione messaggio: " +
                        msgid + " " +
                        durata.toString() + " mill" );
                   Utility.logger(
                        AP.DEBUG,
                        "IXPReceiverMDB7.processa(Message msg) terminato");
              } catch (Throwable e) {
                   getMessageDrivenContext().setRollbackOnly();
                   try {
                        Utility.myExceptionHandler(
                             "E",
                             "1",
                             "4028",
                             "IXPReceiverMDB.onMessage()",
                             e);
                   } catch (Throwable ex) {
                        ex.printStackTrace();
    Thanks in advance.
    Edited by: serpichetto on 16-mag-2011 1.24

  • Current server is the coordinator and transaction is not found

    Hi,
    We're using Weblogic 8.1 SP3. We have a single weblogic domain and 2 clusters in it. EAR1 is deployed in cluster 1 and EAR2 is deployed in cluster 2. EAR2 is compiled and created using j2ee.jar and not weblogic.jar.
    We have a MessageDrivenBean which is CMT / Required in EAR1 calls a BMT Stateless Session Bean in EAR2.
    A new transaction is begun in the BMT SB method and commit or rollback is called based on exception. A RuntimeException is thrown back to the MDB in case the transaction is rolled back in Bean Managed SB.
    Sometimes from the Bean Managed SB the following exception is thrown:
    javax.transaction.TransactionRolledbackException: Current server is the coordinator and transaction is not found. It was probably rolled back and forgotten already.
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at com.oakgrovesystems.reactor.frontDesk.EJBFrontDeskBean_1gq9kv_EOImpl_813_WLStub.handleRequest(Unknown Source)
         at com.oakgrovesystems.reactor.requests.ReactorRequest.send(ReactorRequest.java:212)
         at com.oakgrovesystems.reactor.client.EJBReactorProxy.sendRequest(EJBReactorProxy.java:44)
         at com.oakgrovesystems.reactor.client.AbstractReactorProxy.handleRequest(AbstractReactorProxy.java:52)
         at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at tavant.bpm.client.proxy.DynamicFailoverReactorProxy.invoke(DynamicFailoverReactorProxy.java:84)
         at $Proxy11.handleRequest(Unknown Source)
         at tavant.bpm.client.ProcessHome.handleRequest(ProcessHome.java:298)
         at tavant.bpm.client.ProcessHome.startProcess(ProcessHome.java:87)
         at tavant.bpm.client.processor.CreateWorkflowInstance.startProcess(CreateWorkflowInstance.java:70)
         at tavant.bpm.client.processor.CreateWorkflowInstance.invoke(CreateWorkflowInstance.java:51)
         at tavant.bpm.ejb.AsynchronousProcessorMessageBean.onMessage(AsynchronousProcessorMessageBean.java:58)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    This is not consistently reproducible though it happens when server is heavily loaded. When this exception occurs, the transaction in the BMT Session Bean is actually getting committed! The message gets redelivered from the MDB.
    What could be the problem?
    Regards
    Sandhya

    I'm seeing a similiar problem on our servers recently and thought I would add my problem as well. We are using Weblogic 8.1; don't know which SP is in production. We have an EAR file with an SB EJB that puts messages in a queue. The EAR is deployed in a cluster along with the queues. The errors below occurred in 3 of the 4 WLS instances in our cluster. This happened during a peak period and lasted for several seconds in Production.
    ###<Jul 1, 2005 11:18:12 AM EDT> <Warning> <RMI> <exsdxtxeax1x.prod.xxxx.xxx> <ems-04> <ExecuteThread: '12' for queue: 'web
    logic.kernel.Default'> <<WLS Kernel>> <> <BEA-080006> <Failed to associate the transaction context with the response while marshall
    ing an exception to the client:
    javax.transaction.TransactionRolledbackException: Current server is the coordinator and transaction is not found. It was probably
    rolled back and forgotten already..
    javax.transaction.TransactionRolledbackException: Current server is the coordinator and transaction is not found. It was probably
    rolled back and forgotten already.
    at weblogic.transaction.internal.TransactionManagerImpl.sendResponse(Ljava.lang.Object;)Ljava.lang.Object;(TransactionManag
    erImpl.java:1438)
    at weblogic.rmi.internal.BasicServerRef.associateTxContext(Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundRespo
    nse;)V(BasicServerRef.java:490)
    at weblogic.rmi.internal.BasicServerRef.postInvoke(Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;Lweblogic.rmi.sp
    i.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;Ljava.lang.Throwable;)V(Optimized Method)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(Lweblogic.rmi.spi.InboundRequest;)V(Optimized Method)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(Lweblogic.kernel.ExecuteThread;)V(Optimized Method)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Optimized Method)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
    at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)
    >

  • 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 container transaction

              Hi,
              I had a MDB running quite happily to check for database changes. Because the MDB
              deleted entries form a log table when it had read them I added a container managed
              transaction for the onMessage function. Now I keep getting a Warning message:
              Message Driven Bean 'UpdateCheck' is transacted but the provider defined in the
              ejb is not transacted. Provider should be transacted if onMessage method in MDB
              is transacted.
              I cannot find out what the "Provider" referred to is. I have used the default
              ConnectionFactory - do I need to create my own to enable transactions?
              Peter.
              

    The provider in this case is JMS, and for whatever reason it is not capable of using
              transactions.
              If you are using WL JMS, just don't specify a
              ConnectionFactory inside the descriptor files so that the MDB uses the
              default WL MDB connection factory. If you insist on specifying a connection
              factory, ensure it is one that has "user transactions enabled".
              If you are not using WL JMS, that is whole new ball of wax. Look for
              the white-paper on integrating foreign JMS providers on dev2dev.bea.com
              for answers.
              Tom
              Peter Hughes wrote:
              > Hi,
              > I had a MDB running quite happily to check for database changes. Because the MDB
              > deleted entries form a log table when it had read them I added a container managed
              > transaction for the onMessage function. Now I keep getting a Warning message:
              >
              > Message Driven Bean 'UpdateCheck' is transacted but the provider defined in the
              > ejb is not transacted. Provider should be transacted if onMessage method in MDB
              > is transacted.
              >
              > I cannot find out what the "Provider" referred to is. I have used the default
              > ConnectionFactory - do I need to create my own to enable transactions?
              >
              > Peter.
              

  • Problem with transacted JMS connection factory and transaction timeouts

              We encountered an interesting problem using transacted JMS connection factories.
              An EJB starts a container managed transaction and tries to validate a credit card
              before creating some information to a database for the user, in case of success
              an SMS is sent to the user via the transacted JMS queue. If the credit card authentications
              duration is about the same as the transactions timeout (in this case the default
              30 seconds) sometimes the database inserts is committed but the JMS insert is
              rollbacked. How can this be?
              If the authorization duration is much longer than 30 seconds everything works
              fine (both database and JMS inserts rollbacked), the same is true if a rollback
              is insured by calling EJBContext.setRollbackOnly(). The problem thus occurs only
              if the duration is approximately the same as the transaction timeout, it appears
              that the database insert is not timeouted but the JMS insert is. How can this
              be if they are both participating in the same transaction.
              The JMSConnectionFactory used is a Connection factory with XA-enabled. The result
              is the same also with the default "javax.jms.QueueConnectionFactory" and if we
              configure our own factory with user transactions enabled.
              Any help appreciated!
              

    Tomas Granö wrote:
              > We encountered an interesting problem using transacted JMS connection factories.
              > An EJB starts a container managed transaction and tries to validate a credit card
              > before creating some information to a database for the user, in case of success
              > an SMS is sent to the user via the transacted JMS queue. If the credit card authentications
              > duration is about the same as the transactions timeout (in this case the default
              > 30 seconds) sometimes the database inserts is committed but the JMS insert is
              > rollbacked. How can this be?
              It should not be.
              >
              > If the authorization duration is much longer than 30 seconds everything works
              > fine (both database and JMS inserts rollbacked), the same is true if a rollback
              > is insured by calling EJBContext.setRollbackOnly(). The problem thus occurs only
              > if the duration is approximately the same as the transaction timeout, it appears
              > that the database insert is not timeouted but the JMS insert is. How can this
              > be if they are both participating in the same transaction.
              >
              > The JMSConnectionFactory used is a Connection factory with XA-enabled. The result
              > is the same also with the default "javax.jms.QueueConnectionFactory" and if we
              > configure our own factory with user transactions enabled.
              >
              > Any help appreciated!
              Make sure that your session is not "transacted". In other words,
              the first parameter to createSession() must be false. There is an
              unfortunate name re-use here. If a session is "transacted", it
              maintains an independent "inner transaction" independent of the
              outer transaction. From the above description, it seems unlikely
              that your application has this wrong, as you say that
              "setRollbackOnly" works - but please check anyway.
              Make sure that you are using a true XA capable driver and database
              (XA "emulation" may not suffice)
              Beyond the above, I do not see what can be going wrong. You
              may want to try posting to the transactions and jdbc newsgroups. Note
              that JMS is appears to be exhibiting the correct behavior, but the
              JDBC operation is not. The JDBC operation appears to have
              its timeout independent of the transaction monitor's timeout.
              Tom
              

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • 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

  • Passivation strategy question: "None" and "transaction"

    What's the exact meaning of these two choices "None" and "transaction" for
    passivation strategy?
    Thanks,
    Levi

    No, Arjuna is right. Passivation-strategy is never used in WLS 6. It's been
    removed from the descriptors in the upcoming WLS 7.
    -- Rob
    Nick Minutello wrote:
    I dont think it has been deprecated.
    Whether it is used or not depends on the concurrency strategy.
    Quoted "The passivation-strategy element determines whether or not WebLogic
    Server maintains the intermediate state of entity EJBs in its cache" from
    http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071446
    -Nick
    "Arjuna Chala" <[email protected]> wrote in message
    news:[email protected]..
    I think passivation-strategy has been deprecated for WLS version >= 6 andit
    does not do anything in these versions.
    "levi" <[email protected]> wrote in message
    news:[email protected]..
    What's the exact meaning of these two choices "None" and "transaction"
    for
    passivation strategy?
    Thanks,
    Levi

Maybe you are looking for

  • Can I install a DVDRW drive on my Satellite Pro A10?

    I would like to upgrade the DVD ROM/CDRW drive (SD-R2412) on my Satellite Pro A10 to a DVDRW drive so I can burn DVDs. I have purchased a Toshiba DVDRW drive (TS-L632), as it is exactly the same size and shape as the existing DVD ROM drive, the same

  • OCS on windows error in starting oracle

    Dear All I have Installed collab. Suite 904 single-box to Windows 2000, installation was ok, every thing was working. After restart when I try to start oracle by issuing "/as sysdba" it gives me error of insufficient privileges. I am not sure what we

  • File name used by plug-in for saving the image file.

    I have a program that creates a web page that has an object tag with a call to a program and that program delivers a PDF file.  When my users want to save that image the name of the image is a random name.  Is there any way to make the plug-in, Adobe

  • Mail enabled list not picking up items from the drop folder.

    Hi all,  I'm sorry if this has already been addressed but my searches didn't turn up anything that helped. Our site has some mail enabled lists, that used to work and now do not.  Here is a list of things I've verified and done. 1.  Verified that ema

  • Getting Apple ID does not have permission to access iTunes Connect.

    After creating an appleid, filling out the applicadtion and email verifying, I'm still getting the error that this apple id does not have permission to access Itunes Connect.