Use transacted session in MDB

          Hi,
          If I use transacted session in MDB with container managed transaction, dose the
          weblogic ignore the transacted setting or start in it's own transaction. I looked
          the JMS Tutorial from Sun, the J2EE server just ignore the transacted setting,
          treated it as non-transacted session.
          Thanks
          

          Thanks, Greg. I created another XAQCF in MQ JMSADMIN, but still did not help. The
          strange part is when this exception happens, in the Event Viewer there is a Message:
          An internal Websphere MQ Error has occurred'. In the Trace Log of MQ, the Major
          Error Code reported is arcE_XAER_PROTO.
          Has anyone encountered this error? The same code works fine when enlist an XAQCF
          defined in Weblogic and PUT into a Weblogic JMS Queue instead within the same
          XA Transaction. I am attaching the stack trace to this message, just in case,
          someone has useful pointers to help me. May be this is MQ Specific though I made
          sure I have the latest FixPack for MQ installed.
          Thanks,
          Sridhar
          "Greg Brail" <[email protected]> wrote:
          >Yeah. This comes up from time to time. MQ is upset because it wants to
          >be
          >enlisted in the JTA transaction, but JTA is not enlisting it because
          >it
          >thinks it's already enlisted. It thinks it's already enlisted because
          >the
          >same MQ connection factory was used for the MDB input queue, even though
          >it's a different JMS connection and session.
          >
          >You can avoid this by creating another "XAQCF" object in the MQ JNDI
          >space
          >and giving it a different name. If you do that -- essentially use different
          >connection factories for the MDB's input and output queues -- then this
          >will
          >work.
          >
          >Also, the transaction enlistement code in 8.1 that supports the
          >"resource-ref" feature avoids this problem.
          >
          > greg
          >
          >"Sridhar Krishnaswamy" <[email protected]> wrote in message
          >news:[email protected]...
          >>
          >> Hi Greg:
          >> I assume you meant to getXAResource() from an Object of type
          >XAQueueSession. Here
          >> is the code I tried within the onMessage() method of the MDB:
          >>
          >> XAQueueConnectionFactory factory = (XAQueueConnectionFactory)
          >ctx.lookup("XAQCF")
          >> ;
          >> XAConnection connection = factory.createXAQueueConnection() ;
          >>
          >> XAQueueSession mqSession = connection.createXAQueueSession() ;
          >> XAResource mqResource = mqSession.getXAResource() ;
          >> Transaction tran = TxHelper.getTransaction() ;
          >> tran.enlist(mqResource) ;
          >>
          >> //Then I was going to get the QueueSession Object from XAQueueSession,
          >obtain
          >> the Queue
          >> //Object from JNDI, create the Sender
          >> //and call the send. But I commented out these calls. Even then, after
          >the
          >onMessage
          >> Method
          >> // completes, I get the following error:
          >>
          >> javax.transaction.SystemException: start() failed on resource
          >'com.ibm.mq.MQXAResource':
          >> XAER_PROT : Routine was invoked in an improper context
          >> javax.transaction.xa.XAException: XA Operation failed. see errorcode
          >(which I
          >> am assuming is XAER_PROT).
          >>
          >> Any idea, what I am doing wrong?
          >>
          >>
          >>
          >>
          >> "Greg Brail" <[email protected]> wrote:
          >> >In 7.0, you can do your MQ "put" inside the same JTA transaction that
          >> >was
          >> >used to receive the message for the MDB, but you have to do the
          >transaction
          >> >enlistment yourself. Basically, you have to use the class
          >> >weblogic.transaction.TxHelper class to get a reference to the current
          >> >transaction, then call "enlistResource" on the transaction using the
          >> >JTA
          >> >"XAResource" that you get from the MQ JMS "Session" object. I'm sure
          >> >we've
          >> >posted the code in this newsgroup before, but I don't know where,
          >so
          >> >it
          >> >would look something like:
          >> >
          >> >// First, get the MQ QueueSession object you're going to use to send
          >> >the
          >> >message
          >> >QueueSession mqSession = mqConnection.createQueueSession(false, 0);
          >> >XAResource mqResource = mqSession.getXAResource();
          >> >weblogic.transaction.Transaction tran =
          >> >weblogic.transaction.TxHelper.getTransaction();
          >> >tran.enlistResource(mqResource);
          >> >// Now send your message
          >> >
          >> >In 8.1, this will still work, but it's not necessary. If you register
          >> >the MQ
          >> >XA connection factory as a "resource-reference" in your EJB deployment
          >> >descriptors and look it up using java:comp/env the way the documentation
          >> >link way below describes, then this transaction enlistment happens
          >> >automatically. This only happens when you use the "resource-reference"
          >> >feature (which means that old code will still work if it does NOT
          >use
          >> >this
          >> >feature), and it's only in 8.1.
          >> >
          >> > greg
          >> >
          >> >"Sridhar Krishnaswamy" <[email protected]> wrote in
          >message
          >> >news:[email protected]...
          >> >>
          >> >> Hi Greg:
          >> >> Is the Statement
          >> >>
          >> >> 'But in this case, you don't get a "non-transactional" session,
          >but
          >> >actually a
          >> >> session that participates in the current JTA transaction for the
          >thread
          >> >where
          >> >> your EJB is running'
          >> >>
          >> >> also true in the case of an MDB running in Weblogic 7.0 (Container
          >> >Managed
          >> >Transactions)
          >> >> driven by an XAQCF and a Foreign JMS Provider such as MQSeries?
          >In
          >> >other
          >> >words,
          >> >> if I want the MDB to PUT the Message into an MQSeries Queue, can
          >the
          >> >PUT
          >> >be invoked
          >> >> under the Context of the Same XA Transaction? My understanding is
          >that
          >> >WebLogic
          >> >> 7.0 doesn't support send
          >> >> messages out of an MDB within the same XA transaction if the MDB
          >is
          >> >> XA-driven by a foreign JMS provider. Please let me know if this
          >is
          >> >false.
          >> >If true,
          >> >> does Weblogic 8.1 also have this restriction?
          >> >>
          >> >> Thanks,
          >> >> Sridhar Krishnaswamy.
          >> >>
          >> >> "Greg Brail" <[email protected]> wrote:
          >> >> >What do you mean by "use transacted session in MDB?" Are you creating
          >> >> >a new
          >> >> >session inside your MDB, or do you mean something else?
          >> >> >
          >> >> >The only Sun thing I can think of is in code that looks like this:
          >> >> >
          >> >> >InitialContext ctx = new InitialContext();
          >> >> >QueueConnectionFactory qcf = ctx.lookup("java:comp/env/jms/QCF");
          >> >> >Queue queue = ctx.lookup("java:comp/env/jms/Queue");
          >> >> >QueueConnection connection = qcf.createQueueConnection();
          >> >> >// Create "transacted" session:
          >> >> >QueueSession session = connection.createQueueSession(true, 0);
          >> >> >QueueSender sender = session.createQueueSender(queue);
          >> >> >TextMessage message = session.createTextMessage("Hello, world");
          >> >> >sender.send(message);
          >> >> >connection.close();
          >> >> >
          >> >> >If you do this, and exactly this, inside an EJB, including the
          >use
          >> >of
          >> >> >"java:comp/env/jms", in WebLogic Server 8.1, then we do indeed
          >ignore
          >> >> >the
          >> >> >"transacted" flag when you create the session, just like Sun says
          >> >we
          >> >> >should
          >> >> >in the EJB and J2EE specs. But in this case, you don't get a
          >> >> >"non-transactional" session, but actually a session that participates
          >> >> >in the
          >> >> >current JTA transaction for the thread where your EJB is running.
          >> >> >
          >> >> >The idea is that if you are working inside an EJB, you don't use
          >> >transacted
          >> >> >sessions -- you use the transaction control given to you by the
          >EJB
          >> >> >container, including the UserTransaction interface and/or the various
          >> >> >container-managed transaction flags, rather than the JMS "transacted
          >> >> >session".
          >> >> >
          >> >> >You can find more information here:
          >> >> >
          >> >> >http://e-docs.bea.com/wls/docs81/jms/j2ee_components.html
          >> >> >
          >> >> > greg
          >> >> >
          >> >> >"Jen" <[email protected]> wrote in message
          >> >> >news:[email protected]...
          >> >> >>
          >> >> >> Hi,
          >> >> >>
          >> >> >> If I use transacted session in MDB with container managed
          >transaction,
          >> >> >dose the
          >> >> >> weblogic ignore the transacted setting or start in it's own
          >> >transaction.
          >> >> >I
          >> >> >looked
          >> >> >> the JMS Tutorial from Sun, the J2EE server just ignore the
          >transacted
          >> >> >setting,
          >> >> >> treated it as non-transacted session.
          >> >> >> Thanks
          >> >> >
          >> >> >
          >> >>
          >> >
          >> >
          >>
          >
          >
          [eRRORS.txt]
          

Similar Messages

  • Transactional Session JMS Adapter

    Hi,
    i'm using a JMS sender and receiver adapter. Everything works but i can't understand if it'could be better to use a Transactional Session in Jms setting. I've found a lot of documentation about jms adapter configuration, but not so much information about Transactional Session field.
    Could somebody explain me something more??
    When can i use transactional session?
    Thanks a lot.
    Bye, bye..

    Hi,
    The Transactional Session in JMS is used to persist the messages or may get roll back if in case of failure.
    The JMS adapter (Java Message Service) enables you to connect messaging systems to the Integration Engine or the PCK. The messages will be processed in Queue i.e WebSphere MQ series, SonicMQ and others...
    Suppose in case of failure of the connectivity the messages maintained in queue may lost. That would be serious problem if the queue is maintained with the messages having important data from production landscape.
    If you enable a transactional JMS session, set the indicator. The processing of a message will be safe, a transactional session ends either with a COMMIT, or in the case of an error, with a ROLLBACK. So there will not be any chance of loss of the messages in queue.
    If the session is not transactional, there can be duplicates or lost messages.
    I hope now it will pretty clear to you the purpose of Transactional session.
    Thanks
    Swarup

  • Transaction using stateful session bean.

    All,
    I was implementing "Transaction" part using statefull session(trying to understand how transaction work).
    I created a Statefull session bean, here in one method create 2 sql queries
    query1:update Employees set LastName='newname' where EmployeeID = 9
    query2:update Customers set CompanyName = 'newname Inc.' ContactName = 'Maria Anders'
    "query1" works fine, but "query2" is not correct(syntax error) hence will not be executed. This will throw a SQLException.
    According to EJBspec, rollback will happen if there is a system exception. And I guess SQLException is systemexception.
    But when I query "Employees" table, I get the data updated through the "query1".
    What I was excepting was the first query which was executed should have rolled back because the second query has thrown a SQLException.
    I tried using ContainerManaged transaction and BeanManaged transaction.
    But in both cases transaction is not getting rolled back.
    I have tried with REQUIRED and REQUIRESNEW attributes for container managed transactions with Isolation level as Read Commited.
    Is my understanding correct?
    TIA,
    Vijay

    Tried using Bean managed transactions but with the same result. Given below is the sample code.
    UserTransaction uts = null;
    try {
    uts = (UserTransaction)(ctx.getUserTransaction());
    uts.begin();
    Connection con = null;
    con = getCountConnection();
    PreparedStatement ps = con.prepareStatement(sqlselectUserId);
    ps.executeUpdate();
    PreparedStatement ps1 = con.prepareStatement(sqlselectUserDetails);
    ps1.executeUpdate();
    uts.commit();
    catch(SQLException e) {
         uts.rollback();

  • How to use transaction in jsp in CQ5.5

    Hello,
    i'm playing around with transactions Jackrabbit should be capable of
    I didn't find any resource to that specific topic.
    Here's my code so far, but it isn't working properly...
    final SlingRepository repository = sling.getService(SlingRepository.class);
    Session session = repository.loginAdministrative(null);
    UserTransaction utx = sling.getService(UserTransaction.class);
    utx.begin();
    out.println(utx.getStatus());
    Node node = session.getNode("/path/to/a/content");
    node.setProperty("a","property");
    session.save();
    out.println(utx.getStatus());
    utx.rollback();
    session.logout();
    Expected result: The Property "a" is not appended to the node because Transaction was rolled back
    Achieved result so far: The property is saved to the node.
    What am i doing wrong?
    What is the preferred way to use transaction?
    Background: we are doing some asset operations in user profile node that take some time. It seems that the reverse replication launcher starts in between the process and breaks the replication process every now and then
    Thanks for advice
    Marc

    I'm not very familiar with ODP .NET so I'm not sure what OracleTransactions is or what it actually does. TTClasses implements the normal TimesTen (ANSI) transaction model:
    1. Transactions are specific to a database connection
    2. You are always in a transaction except (a) immediately after you have connected and (b) immediately after a commit or rollback
    3. The first database operation (including SELECT) executed after (a) or (b) above starts a transaction (there is no explicit 'begin work' operation)
    4. A transaction is completed by either committing (call the TTConnection.commit() method or execute the COMMIT [WORK] SQL statement) or by rolling bacl (call the TTConnection.rollback() method or execute the ROLLBACK [WORK] SQL statement).
    Does this answer the question? If not, please provide more details on what information you are seeking.
    Thanks,
    Chris

  • NON-transactional session bean access entity bean

    We are currently profiling our product using Borland OptmizeIt tool, and we
    found some interesting issues. Due to our design, we have many session beans which
    are non transactional, and these session beans will access entity beans to do
    the reading operations, such as getWeight, getRate, since it's read only, there
    is no need to do transaction commit stuff which really takes time, this could
    be seen through the profile. I know weblogic support readonly entity bean, but
    it seems that it only has benefit on ejbLoad call, my test program shows that
    weblogic still creates local transaction even I specified it as transaction not
    supported, and Transaction.commit() will always be called in postInvoke(), from
    the profile, we got that for a single method call, such as getRate(), 80% time
    spent on postInvoke(), any suggestion on this? BTW, most of our entity beans are
    using Exclusive lock, that's the reason that we use non-transactional session
    bean to avoid dead lock problem.
    Thanks

    Slava,
    Thanks for the link, actually I read it before, and following is what I extracted
    it from the doc:
    <weblogic-doc>
    Do not set db-is-shared to "false" if you set the entity bean's concurrency
    strategy to the "Database" option. If you do, WebLogic Server will ignore the
    db-is-shared setting.
    </weblogic-doc>
    Thanks
    "Slava Imeshev" <[email protected]> wrote:
    Hi Jinsong,
    You may want to read this to get more detailed explanation
    on db-is-shared (cache-between-transactions for 7.0):
    http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1127563
    Let me know if you have any questions.
    Regards,
    Slava Imeshev
    "Jinsong HU" <[email protected]> wrote in message
    news:[email protected]...
    Thanks.
    But it's still not clear to me in db-is-shared setting, if I specifiedentity
    lock as database lock, I assumed db-is-shared is useless, because foreach
    new
    transaction, entity bean will reload data anyway. Correct me if I amwrong.
    Jinsong
    "Slava Imeshev" <[email protected]> wrote:
    Jinsong,
    See my answers inline.
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    Hi Slava,
    Thanks for your reply, actually, I agree with you, we need to
    review
    our db
    schema and seperate business logic to avoid db lock. I can not say,guys,
    we need
    to change this and that, since it's a big application and developedsince
    EJB1.0
    spec, I think they are afraid to do such a big change.Total rewrite is the worst thing that can happen to an app. The
    better aproach would be identifying the most critical piece and
    make a surgery on it.
    Following are questions in my mind:
    (1) I think there should be many companies using weblogic serverto
    develop
    large enterprise applications, I am just wondering what's the maintransaction/lock
    mechanism that is used? Transional session / database lock,
    db-is-shared
    entity
    I can't say for the whole community, as for my experience the standard
    usage patthern is session fasades calling Entity EJBs while having
    Required TX attribute plus plain transacted JDBC calls for bulk
    reads or inserts.
    is the dominant one? It seems that if you speficy database lock,
    the
    db-is-shared
    should be true, right?Basically it's not true. One will need db-is-shared only if thereare
    changes
    to the database done from outside of the app server.
    (2) For RO bean, if I specify read-idle-timeout to 0, it shouldonly
    load
    once at the first use time, right?I assume read-timeout-seconds was meant. That's right, but if
    an application constantly reads new RO data, RO beans will be
    constantly dropped from cache and new ones will be loaded.
    You may want to looks at server console to see if there's a lot
    of passivation for RO beans.
    (3) For clustering part, have anyone use it in real enterpriseapplication?
    My concern, since database lock is the only way to choose, how aboutthe
    affect
    of ejbLoad to performance, since most transactions are short live,if high
    volume
    transactions are in processing, I am just scared to death about
    the
    ejbLoad overhead.
    ejbLoad is a part of bean's lifecycle, how would you be scared ofit?
    If ejbLoads take too much time, it could be a good idea to profile
    used SQLs. Right index optimization can make huge difference.
    Also you may want cosider using CMP beans to let weblogic
    take care about load optimization.
    (4) If using Optimization lock, all the ejbStore need to do
    version
    check
    or timestamp check, right? How about this overhead?As for optimistic concurrency, it performs quite well as you can
    use lighter isolation levels.
    HTH,
    Slava Imeshev
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    We are using Exclusive Lock for entity bean, because of we do
    not
    want
    to
    load
    data in each new transaction. If we use Database lock, that means
    we
    dedicate
    data access calls to database, if database deadlock happens,
    it's
    hard
    to
    detect,
    while using Exclusive lock, we could detect this dead lock in
    container
    level.
    The problem is, using Exclusive concurrency mode you serialize
    access to data represented by the bean. This aproach has negative
    effect on ablity of application to process concurrent requests.As
    a
    result the app may have performance problems under load.
    Actually, at the beginnning, we did use database lock and usingtransactional
    The fact that you had database deadlocking issues tells that
    application logic / database schema may need some review.
    Normally to avoid deadlocking it's good to group database
    operations mixing in updattes and inserts into one place so
    that db locking sequence is not spreaded in time. Moving to
    forced serialized data access just hides design/implementation
    problems.
    session bean, but the database dead lock and frequent ejbLoad
    really
    kill
    us,
    so we decided to move to use Exclusive lock and to avoid dead
    lock,
    we
    change
    some session bean to non-transactional.Making session beans non-transactions makes container
    creating short-living transactions for each call to entity bean
    methods. It's a costly process and it puts additional load to
    both container and database.
    We could use ReadOnly lock for some entity beans, but since weblogicserver will
    always create local transaction for entity bean, and we found
    transaction
    commit
    is expensive, I am arguing why do we need create container leveltransaction for
    read only bean.First, read-only beans still need to load data. Also, you may seeRO
    beans
    contanly loading data if db-is-shared set to true. Other reason
    can
    be
    that
    RO semantics is not applicable the data presented by RO bean (forinstance,
    you have a reporting engine that constantly produces "RO" data,
    while
    application-consumer of that data retrieves only new data and neverasks
    for "old" data). RO beans are good when there is a relatively stable
    data
    accessed repeatedly for read only access.
    You may want to tell us more about your app, we may be of help.
    Regards,
    Slava Imeshev
    I will post the performance data, let's see how costful
    transaction.commit
    is.
    "Cameron Purdy" <[email protected]> wrote:
    We are currently profiling our product using Borland
    OptmizeIt
    tool,
    and we
    found some interesting issues. Due to our design, we have
    many
    session
    beans which
    are non transactional, and these session beans will access
    entity
    beans
    to
    do
    the reading operations, such as getWeight, getRate, since
    it's
    read
    only,
    there
    is no need to do transaction commit stuff which really takes
    time,
    this
    could
    be seen through the profile. I know weblogic support readonly
    entity
    bean,
    but
    it seems that it only has benefit on ejbLoad call, my test
    program
    shows
    that
    weblogic still creates local transaction even I specified
    it
    as
    transaction not
    supported, and Transaction.commit() will always be called
    in
    postInvoke(),
    from
    the profile, we got that for a single method call, such as
    getRate(),
    80%
    time
    spent on postInvoke(), any suggestion on this? BTW, most of
    our
    entity
    beans are
    using Exclusive lock, that's the reason that we use
    non-transactional
    session
    bean to avoid dead lock problem.I am worried that you have made some decisions based on an improper
    understand of what WebLogic is doing.
    First, you say "non transactional", but from your description
    you
    should
    have those marked as tx REQUIRED to avoid multiple transactions
    (since
    non-transactional just means that the database operation becomesits
    own
    little transaction).
    Second, you say you are using exclusive lock, which you shouldonly
    use
    if
    you are absolutely sure that you need it, (and note that it
    does
    not
    work in
    a cluster).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "Jinsong Hu" <[email protected]> wrote in message
    news:[email protected]...
    >

  • Not be able to obtain a transacted session within stateless session bean

    I need some assistance on creating a transacted session. For some reason while within a stateless session bean, I am unable to create a transacted session even though I'm specifying to create the transacted queue session. Can anyone provide any assistance to me on this? It would be much appreciated.
    Here is the code snippets involved with the problem:
    Code snipet from ejb-jar.xml:
    <session>
    <display-name>Initial Request</display-name>
    <ejb-name>InitialRequestBean</ejb-name>
    <ejb-class>com.raytheon.rds.jms.InitialRequestBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    Code from stateless session bean:
    static Logger logger;
    private QueueConnectionFactory connectionFactory;
    private SessionContext sc;
    private Queue requestQueue;
    public String processRequest(String msgBody)
    logger.log(Level.INFO, "In processRequest(String).", msgBody);
    QueueConnection con = null;
    QueueSession session = null;
    QueueSender sender = null;
    TextMessage message = null;
    String messageID = null;
    QueueReceiver receiver = null;
    TemporaryQueue replyQueue = null;
    boolean transacted = false;
    try
    //Create the infrastructure (ie. The connection & the session)
    logger.log(Level.FINE, "Creating connection");
    con = connectionFactory.createQueueConnection();
    logger.log(Level.FINE, "Creating session");
    session = con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    //Note: This line above was changed in all possible permutation and still didn't work such as using Session.SESSION_TRANSACTED
    transacted = session.getTransacted();
    logger.log(Level.FINE, "Is session transacted? : " + transacted);
    //Note: This line above is constantly saying false
    //Now first, setup the temporary reply queue and its listener
    replyQueue = session.createTemporaryQueue();
    logger.log(Level.FINE, "Creating receiver/consumer");
    receiver = session.createReceiver(replyQueue);
    con.start();
    //Now create the requestor that will make the request message and put it on the request queue
    logger.log(Level.FINE, "Creating Requestor/Producer");
    sender = session.createSender(requestQueue);
    //Now create the message and make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
    message = session.createTextMessage();
    message.setJMSReplyTo(replyQueue);
    logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
    //Now add the actual info you want to send
    message.setText(msgBody);
    //Now send the message
    logger.log(Level.INFO, "Sending message: " + message.getText());
    sender.send(message);
    //Now wait until we get a response
    logger.log(Level.FINE, "Waiting for the response message");
    Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
    //Process the message
    logger.log(Level.FINE, "Processing the response message");
    if(null != responseMsg)
    logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
    messageID = processMessage(responseMsg);
    logger.log(Level.FINE, "Response is : " + messageID);
    //close the connection
    logger.log(Level.FINE, "Stopping the connection");
    con.stop();
    catch (Throwable t)
    // JMSException could be thrown
    logger.log(Level.SEVERE, "Exception Thrown in sendRequest: ", t);
    sc.setRollbackOnly();
    finally
    //Close the sender
    if (sender != null)
    try
    logger.log(Level.FINE, "Closing the sender");
    sender.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the sender to the request queue: ", e);
    else
    logger.log(Level.FINE, "Sender is already closed.");
    //Close the receiver
    if (receiver != null)
    try
    logger.log(Level.FINE, "Closing the receiver");
    receiver.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the receiver to the request queue: ", e);
    else
    logger.log(Level.FINE, "Receiver is already closed.");
    //Close the session
    if (session != null)
    try
    logger.log(Level.FINE, "Closing the session");
    session.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the session to the request queue: ", e);
    else
    logger.log(Level.FINE, "Session is already closed.");
    //Close the connection
    if (con != null)
    try
    logger.log(Level.FINE, "Closing the connection");
    con.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the connection to the reply queue: ", e);
    else
    logger.log(Level.FINE, "Connection is already closed.");
    return messageID;
    }

    I found the answer through lots of painful searching.
    http://blogs.sun.com/fkieviet/entry/request_reply_from_an_ejb
    This weblog from Frank Kieviet from a sun blog explains what's happening behind the scenes.
    Then I proceeded to create a Bean-Managed Transaction out of my EJB, which is using EJB 3.0. This requires the tag:
    @TransactionManagement(value= TransactionManagementType.BEAN)
    Note: I got this information from http://download.oracle.com/docs/cd/B31017_01/web.1013/b28221/servtran001.htm#BAJIBAFF
    Then I just added the code specified in Frank's blog and everything is working now. The main portion of the code looks like this now:
    //begin the user transaction
    ctx.getUserTransaction().begin();
    //Create the infrastructure (ie. The connection & the session)
    logger.log(Level.FINE, "Creating connection");
    con = connectionFactory.createQueueConnection();
    //Create the session
    logger.log(Level.FINE, "Creating session");
    session = con.createQueueSession(false, Session.SESSION_TRANSACTED);
    transacted = session.getTransacted();
    logger.log(Level.FINE, "Is session transacted? : " + transacted);
    //Now create the sender that will make the request message and put it on the request queue
    logger.log(Level.FINE, "Creating Sender");
    sender = session.createSender(requestQueue);
    //Now create the message
    message = session.createTextMessage();
    //Now add the actual info you want to send
    message.setText(msgBody);
    logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
    //Now first, setup the temporary reply queue and its listener
    replyQueue = session.createTemporaryQueue();
    if(null != replyQueue)
    logger.log(Level.FINE, "Created temporary queue: " + replyQueue.getQueueName());
    else
    logger.log(Level.FINE, "Temporary Queue could not be created.");
    //make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
    message.setJMSReplyTo(replyQueue);
    //Now send the message
    logger.log(Level.INFO, "Sending message: " + message.getText());
    sender.send(message);
    //Now start the connection
    logger.log(Level.FINE, "Starting the connection");
    con.start();
    //commit the changes
    ctx.getUserTransaction().commit();
    ctx.getUserTransaction().begin();
    //Create the receiver
    logger.log(Level.FINE, "Creating Receiver");
    receiver = session.createReceiver(replyQueue);
    //Now wait until we get a response
    logger.log(Level.FINE, "Waiting for the response message");
    Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
    //Process the message
    logger.log(Level.FINE, "Processing the response message");
    if(null != responseMsg)
    logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
    else
    logger.log(Level.FINE, "No response came back.");
    messageID = processMessage(responseMsg);
    logger.log(Level.FINE, "Response is : " + messageID);
    logger.log(Level.FINE, "Transaction is complete");
    //commit the changes
    ctx.getUserTransaction().commit();

  • How to get transacted session in direct mode with jmsra adapter

    Hi,
    I use MQ 4.4u1 release with GF in EMBEDDED mode. I configured several connection factories with NoTransaction/LocalTransaction/XATransaction support. In my app I get a connection factory from JNDI tree, create connection/session/producer and send several messages to queue. Everything works fine when I don't use transactions. But, when I want to send messages in one transaction, the connection always provided to me non-transacted session. The session created via
    Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
    request. I check the session transacted state and acknowledge mode right after i get it:
    log.fine("Session: " + session + "; transacted: " + session.getTransacted() + "; ackMode: " + session.getAcknowledgeMode());
    The log shows me that the session is not transacted and ackMode is 0 (DUPS_OK_ACKNOWLEDGE). If I try to commit the session after messages were sent I get the correct exception:
    javax.jms.IllegalStateException: MQJMSRA_DS4001: commit():Illegal for a non-transacted Session:sessionId=3361979872663370240
    Does anyone know how to get transactional session in direct mode?
    Thanks, Denis.

    I mentioned LOCAL because I misread your post and thought you were suggesting that LOCAL mode behaved differently.
    If you want to send messages in a transaction from within a Servlet then I think you're expected to use a UserTransaction: Here's an example that worked for me:
            Connection connection = outboundConnectionFactory.createConnection();
            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
            userTransaction.begin();
            MessageProducer producer = session.createProducer(outboundQueue);
            int numberOfMessages = 10;
            for (int i = 0; i<numberOfMessages; i++) {
                Message message = session.createTextMessage("Hello world");
                producer.send(message);
            userTransaction.commit();
            connection.close();I obtained the UserTransaction with this resource declaration:
        @Resource(name = "java:comp/UserTransaction")
        private UserTransaction userTransaction;The EJB spec explicitly states that local transactions aren't supported in EJBs; I haven't found such an explicit statement for Servlets but suspect that JMSRA is taking the same approach.
    As for imq.jmsra.direct.disableCM property - this appears to disable connection pooling and from your post changes other behaviour as well. How did you find out about it (other than by examining the code)? As far as I can see this is not a documented feature and is not necessarily tested or supported.

  • Using Transactions

    Hi All,
    I want to implement Transaction in my session bean.
    My session bean function :
    insert(a, b, c){
    ut = sessionctx.getUserTransaction();
    ut.begin();
    try{
    obj1.insert(a);
    throw CustomException(" Custom exception");
    obj1.insert(b);
    obj1.insert(c);
    }catch(Exception e){
    ut.rollback();
    ut.commit();
    where obj1 - uses connection pool for making any kind of database
    operations.
    I have mentioned Bean Managed transactions in my ejb-jar.xml
    I am not using entity beans.
    From the above test it is expected that the first insert(a) should get
    rollback.
    but it is not so happening with my case.
    Am I wrong somewhere in Using Transaction Concept ?
    Is there anyplace where i have missed some configuration setting ? somewhere
    in my connection pool ?
    in ejb-jar.xml ? in weblogic-ejb-jar.xml ?
    Any one can help me with this problem ? Any examples ? any links ?
    I am using weblogic 5.1 service pack 10 on windows 2000 machine. Is
    transaction supported with that ?
    Can anyone help me in these regard ?
    Thanks in advance.
    Bhavin Raichura

    Hi.
    Please try posting this question in weblogic.developer.interest.transaction or
    weblogic.developer.interest.ejb.
    Thanks,
    Michael
    Bhavin Raichura wrote:
    Hi All,
    I want to implement Transaction in my session bean.
    My session bean function :
    insert(a, b, c){
    ut = sessionctx.getUserTransaction();
    ut.begin();
    try{
    obj1.insert(a);
    throw CustomException(" Custom exception");
    obj1.insert(b);
    obj1.insert(c);
    }catch(Exception e){
    ut.rollback();
    ut.commit();
    where obj1 - uses connection pool for making any kind of database
    operations.
    I have mentioned Bean Managed transactions in my ejb-jar.xml
    I am not using entity beans.
    From the above test it is expected that the first insert(a) should get
    rollback.
    but it is not so happening with my case.
    Am I wrong somewhere in Using Transaction Concept ?
    Is there anyplace where i have missed some configuration setting ? somewhere
    in my connection pool ?
    in ejb-jar.xml ? in weblogic-ejb-jar.xml ?
    Any one can help me with this problem ? Any examples ? any links ?
    I am using weblogic 5.1 service pack 10 on windows 2000 machine. Is
    transaction supported with that ?
    Can anyone help me in these regard ?
    Thanks in advance.
    Bhavin Raichura--
    Developer Relations Engineer
    BEA Support

  • Calling a custom BSP application in CRM2007  ICWC using transaction launche

    Hi Experts,
    I created a Z BSP application in se80 which is a statefull application.Now I created a direct link in ICWC for this Bsp application using transaction launcher.
    Now my problem is that the session of this BSP remains active even if I click on some other link in the navigation bar.
    I need a way to end the session as soon as we navigate to some other link on the navigation bar.
    It would also be helpful if I just know the code for killing the session programatically.
    Helpful Answers will be rewarded!!
    Thanks,
    Ashish.

    Hi,
    I am not sure, but according to my understanding u can use CL_BSP_SERVER_SIDE_COOKIE class in ur BSP application to get refrence of ur BSP page.
    When u r in Web UI by the help of this class u can check whether u r in BSP related view or in other then view. If u r in other view then u can set runtime->keep_context = 0.
    Take help from this link for the class related info.
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/bb153aab4a0c0ee10000000a114084/frameset.htm
    Regards
    Gaurav

  • OBIEE | Using Dynamic Session Variable in Physical Layer

    Hi All,
    Any idea if we can use Dynamic Session Variables (I think they are also called Repository Variables) in our physical layer. I basically need to set the value of this variable from dashboard when a link is clicked, and then use this in my SELECT query at physical layer so that OBIEE does not pull all the data from the database tables.
    Regards
    Adeel Javed
    Edited by: user10642426 on Apr 6, 2009 2:03 AM

    Christian,
    Thanks for the quick response, ok we have actually moved to a different solution now, we are actually using Direct Database Request because one of our reports is supposed to be accessing direct transactional system i.e. for this report we are using OBIEE as a reporting tool. We are able to do that and even create links between different reports i.e. based on prompt in Report A filter Report B, but the scenario now is that we need to set a presentation variable from Report A when a navigation link gets clicked, because so far according to our knowledge direct SQL only allows presentation variables in its WHERE clause. So, any ideas how can we set a presentation variable when a navigation link is clicked. Thanks.
    Regards
    Adeel Javed
    Edited by: adeeljaved on Apr 6, 2009 11:43 PM

  • Can we create multiple session in BDC using Call session?

    Hi Experts,
    Can we create  multiple sessions in BDC using Call Session?
    Scenario:
    Program has to upload 1 million records,so can we programmatically create multiple sessions such that after every 50thousand records we create a different session.
    For moment due to large number of records BDC DYNPRO and BDC Field are unable to hold the large number of records,due to which we get a Out of memory error.
    Thanks in advance.
    Shilpa

    Hi
    If ITAB is your table with the data to be transfered:
    Open the first session:
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
      FL_OPEN = 'X'.
    ENDIF.
    LOOP AT ITAB.
    IF FL_OPEN = SPACE.
    Create new session
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
       FL_OPEN = 'X'.
    ENDIF.
    ENDIF.
    Here elaborate your data and fill BDCDATA
    Insert the transaction:
    CALL FUNCTION 'BDC_INSERT'
    IF SY-SUBRC = 0.
      COUNT = COUNT + 1.
      IF COUNT = COUNT_MAX.
        COUNT = 0.
    Close the session
        IF FL_OPEN = 'X'.
          CALL BDC_CLOSE_GROUP
          IF SY-SUBRC = 0.
            FL_OPEN = SPACE.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Max

  • Help on transacted session  (urgent)

    Hi all,
    While creating a transacted Session using separate application for sender and receiver, should both the sender and receiver be in transacted mode?.
    Our session creation looks something like this.
    QueueSession session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE );
    With Queue destinations, is it possible to have two receivers and one sender in a trancated session.

    if i create Sender application in transacted mode then both the receiver's receives the message.
    If i create Sender in Non Transacted mode and Receiver application in transacted & Session.AUTO_ACKNOWLEDGE,
    one receiver receive's around 2 messages (size 26kb) and the other hangs.
    I think I am not commiting at the right place.
    excerpt from the receiver:
    QueueConnectionFactory factory = (QueueConnectionFactory) Context.lookup("QueueConnectionFactory");
    QueueConnection connection = factory.createQueueConnection();
    connection.start();
    session = connection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE );
                   queue = (Queue)jndiContext.lookup(queueName);
    QueueReceiver receiver = session.createReceiver(queue);
                   LoggerFactory.getLogger().logDebug("Application==============Before for") ;
                   receiver.setMessageListener(new SimpleReceiver());
         System.err.println("Message listener has been set");
    catch (Exception exception)
                   System.err.println("Fatal error: " + exception + "\nExiting.....");
    exception.printStackTrace();
    LoggerFactory.getLogger().logDebug(JmsAdminErrs.getSqlErr(exception.getMessage()));
                   System.exit(-1);
    public void onMessage(Message message)
              try
                   if (ackMode == Session.CLIENT_ACKNOWLEDGE)
                        System.out.println("MEssage Recived by onMessage: " + message.getStringProperty("test") + ++i) ;
                        message.acknowledge();
                   System.out.println("MEssage onMessage: " + message.getStringProperty("test") + ++i) ;
                   //session.commit();
              catch (JMSException exception)
                   System.err.println("Warning in ack " + exception);
    }

  • I am posting data for va01 and va02 using BDC session,what happens if

    Hi,
    I am posting some data for va01 and va02 using BDC session,but what happens  if i try to post same data using call transaction.

    Hi,
    That is just another method. You can post the data using Call Transaction as well.
    Just give it a try and in case you face some problem revert back with your issue.
    We will help you to solve the same.
    Hope this helps!!!
    Regards,
    Lalit

  • Combination of call transaction & session methods

    hi,
    how to combine call transaction & session methods in a single transaction.
    give me the exact steps to proceed with the above.

    Hi Saritha,
    Your question is not clear to me but I am assuming your queestion like this
    "Providing choice for user for using either call transaction & Session method for uploading data"
    When you generate the BDC (Batch Data Communication options define the processing mode for a batch input session) program with SHDB, you can remove a lot of unwanted fields by copying this customize abap include program.  It allows you to execute the BDC program immediately without filling up those SAP generate fields.  To run background, just run it as a background job.
    Execute BDC immediately by replacing the include BDCRECX1
    Written by : SAP Basis, ABAP Programming and Other IMG Stuff
                     http://www.sap-img.com
    ***INCLUDE ZBDCRECX1.
    When you generate the program using SHDB, you can replace it
    with this if you want to execute it immediately without having
    to process it using SM35.
    During testing you can used the original include.
    For example,
    include zbdcrecx1.   "After test
    include bdcrecx.     "Before test
    Declare your internal table as RECORD
    for programs doing a data transfer by creating a batch-input session
    and
    for programs doing a data transfer by CALL TRANSACTION USING
    *SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS SESSION RADIOBUTTON GROUP CTU.  "create session
    SELECTION-SCREEN COMMENT 3(20) TEXT-S07 FOR FIELD SESSION.
    selection-screen position 45.
    PARAMETERS CTU RADIOBUTTON GROUP CTU DEFAULT 'X'. "call transaction
    SELECTION-SCREEN COMMENT 48(20) TEXT-S08 FOR FIELD CTU.
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: SESSION NO-DISPLAY,
                CTU     NO-DISPLAY DEFAULT 'X'.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) TEXT-S01 FOR FIELD GROUP.
    selection-screen position 25.
    PARAMETERS GROUP(12).                      "group name of session
    SELECTION-SCREEN COMMENT 48(20) TEXT-S05 FOR FIELD CTUMODE.
    selection-screen position 70.
    PARAMETERS CTUMODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
                                         "A: show all dynpros
                                         "E: show dynpro on error only
                                         "N: do not display dynpro
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: GROUP(12) NO-DISPLAY,
                CTUMODE   NO-DISPLAY DEFAULT 'N'.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) TEXT-S02 FOR FIELD USER.
    selection-screen position 25.
    PARAMETERS: USER(12) DEFAULT SY-UNAME.    "user for session in batch
    SELECTION-SCREEN COMMENT 48(20) TEXT-S06 FOR FIELD CUPDATE.
    selection-screen position 70.
    PARAMETERS CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L'.
                                         "S: synchronously
                                         "A: asynchronously
                                         "L: local
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: USER(12) NO-DISPLAY DEFAULT SY-UNAME,
                CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L' NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) TEXT-S03 FOR FIELD KEEP.
    selection-screen position 25.
    PARAMETERS: KEEP AS CHECKBOX.       "' ' = delete session if finished
                                         "'X' = keep   session if finished
    SELECTION-SCREEN COMMENT 48(20) TEXT-S09 FOR FIELD E_GROUP.
    selection-screen position 70.
    parameters E_GROUP(12).             "group name of error-session
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: KEEP        NO-DISPLAY,
                E_GROUP(12) NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(20) TEXT-S04 FOR FIELD HOLDDATE.
    selection-screen position 25.
    PARAMETERS: HOLDDATE LIKE SY-DATUM.
    SELECTION-SCREEN COMMENT 51(17) TEXT-S02 FOR FIELD E_USER.
    selection-screen position 70.
    PARAMETERS: E_USER(12) DEFAULT SY-UNAME.    "user for error-session
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: HOLDDATE LIKE SY-DATUM NO-DISPLAY,
               E_USER(12) DEFAULT SY-UNAME NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 51(17) TEXT-S03 FOR FIELD E_KEEP.
    selection-screen position 70.
    PARAMETERS: E_KEEP AS CHECKBOX.     "' ' = delete session if finished
                                         "'X' = keep   session if finished
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: E_KEEP NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 51(17) TEXT-S04 FOR FIELD E_HDATE.
    selection-screen position 70.
    PARAMETERS: E_HDATE LIKE SY-DATUM.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN SKIP.
    PARAMETERS: E_HDATE LIKE SY-DATUM NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TEXT-S10 FOR FIELD NODATA.
    PARAMETERS: NODATA DEFAULT '/' LOWER CASE.          "nodata
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: NODATA DEFAULT '/' LOWER CASE NO-DISPLAY.
    *SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) FOR FIELD SMALLLOG.
    PARAMETERS: SMALLLOG as checkbox.  "' ' = log all transactions
                                        "'X' = no transaction logging
    *SELECTION-SCREEN END OF LINE.
    PARAMETERS: SMALLLOG NO-DISPLAY.
      data definition
          Batchinputdata of single transaction
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
          error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
          message texts
    TABLES: T100.
      at selection screen                                                *
    AT SELECTION-SCREEN.
    group and user must be filled for create session
      IF SESSION = 'X' AND
         GROUP = SPACE OR USER = SPACE.
        MESSAGE E613(MS).
      ENDIF.
      open dataset                                                       *
    FORM OPEN_DATASET USING P_DATASET.
      OPEN DATASET P_DATASET IN TEXT MODE.
      IF SY-SUBRC <> 0.
        WRITE: / TEXT-E00, SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
      close dataset                                                      *
    FORM CLOSE_DATASET USING P_DATASET.
      CLOSE DATASET P_DATASET.
    ENDFORM.
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM OPEN_GROUP.
      IF SESSION = 'X'.
        SKIP.
        WRITE: /(20) 'Create group'(I01), GROUP.
        SKIP.
      open batchinput group
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = GROUP
                        USER     = USER
                        KEEP     = KEEP
                        HOLDDATE = HOLDDATE.
        WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ENDIF.
    ENDFORM.
      end batchinput session                                             *
      (call transaction using...: error session)                         *
    FORM CLOSE_GROUP.
      IF SESSION = 'X'.
      close batchinput group
        CALL FUNCTION 'BDC_CLOSE_GROUP'.
        WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ELSE.
        IF E_GROUP_OPENED = 'X'.
          CALL FUNCTION 'BDC_CLOSE_GROUP'.
          WRITE: /.
          WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
        ENDIF.
      ENDIF.
    ENDFORM.
           Start new transaction according to parameters                 *
    FORM BDC_TRANSACTION USING TCODE.
      DATA: L_MSTRING(480).
      DATA: L_SUBRC LIKE SY-SUBRC.
    batch input session
      IF SESSION = 'X'.
        CALL FUNCTION 'BDC_INSERT'
             EXPORTING TCODE     = TCODE
             TABLES    DYNPROTAB = BDCDATA.
        IF SMALLLOG <> 'X'.
          WRITE: / 'BDC_INSERT'(I03),
                   TCODE,
                   'returncode:'(I05),
                   SY-SUBRC,
                   'RECORD:',
                   SY-INDEX.
        ENDIF.
    call transaction using
      ELSE.
        REFRESH MESSTAB.
        CALL TRANSACTION TCODE USING BDCDATA
                         MODE   CTUMODE
                         UPDATE CUPDATE
                         MESSAGES INTO MESSTAB.
        L_SUBRC = SY-SUBRC.
        IF SMALLLOG <> 'X'.
         WRITE: / 'CALL_TRANSACTION',
                  TCODE,
                  'returncode:'(I05),
                  L_SUBRC,
                  'RECORD:',
                  SY-INDEX.
          IF SY-SUBRC = 0.
             FORMAT COLOR OFF.
             WRITE:/ 'Successfully Process ', MESSTAB, RECORD.
          ELSE.
             FORMAT COLOR COL_NEGATIVE.
             WRITE:/ 'Failed Process ', MESSTAB, RECORD.
          ENDIF.
          LOOP AT MESSTAB.
            SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                      AND   ARBGB = MESSTAB-MSGID
                                      AND   MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              L_MSTRING = T100-TEXT.
              IF L_MSTRING CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ENDIF.
              CONDENSE L_MSTRING.
              WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
          ENDLOOP.
          SKIP.
        ENDIF.
    Erzeugen fehlermappe ************************************************
        IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
          IF E_GROUP_OPENED = ' '.
            CALL FUNCTION 'BDC_OPEN_GROUP'
                 EXPORTING  CLIENT   = SY-MANDT
                            GROUP    = E_GROUP
                            USER     = E_USER
                            KEEP     = E_KEEP
                            HOLDDATE = E_HDATE.
             E_GROUP_OPENED = 'X'.
          ENDIF.
          CALL FUNCTION 'BDC_INSERT'
               EXPORTING TCODE     = TCODE
               TABLES    DYNPROTAB = BDCDATA.
        ENDIF.
      ENDIF.
      REFRESH BDCDATA.
    ENDFORM.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.

  • Using SSO Session

    Hi,
    We are using AS 10.1.3.5 to deploy our EAR.(platfoem is OEL 5)
    In our EAR we are Hibernate 3.0 and Struts 2.0 Framework,using JDeveloper 10.1.3.5 and also we are using the SessionAware Interface of Struts 2 to implement session management.
    We have configured this as a partner Application with SSO and OID(10.1.4.3) using "Note 403164.1 " and invoking AS 10.1.2 Reports from our EAR.
    So,we need to use the same SSO session throughout our J2EE Application.
    Where as we need to add some session attribute to the SSO session which we are picking from our custom db table and we need to use those session attributes throughout our application (as long as the SSO session is valid).
    We do not have any idea on using this SSO sessions.(before making this a partner application we were using Servlet Sessions)
    Please suggest how to set some attibutes in the SSO session and retireve the same in our EAR.
    Edited by: Susmit on Jun 14, 2011 7:05 PM

    Susmit
    There are 2 ways you will be configuring SSO in OHS of OAS.
    Static and dynamic.
    Which one you are using ?
    If you are using dynamic i.e using java program, you have the control of the flow. You can make entries of that after successful authentication and delete the entries when the session expires.
    You can always check the session status using java api.
    If you are using static, you should have one servlet filter to track the session.
    Regards
    Chinna

Maybe you are looking for

  • How do I migrate data from my old HDD to the new one I replaced it with?

    I recently upgraded my HDD to a bigger one (160G to 500G). The old HDD still has all of my data which I would like to migrate to the new drive. I purchased a device that a tech at a computer store recommended but when I plug in the old HDD (using thi

  • NEED  Information on BPS( Business Planning & SImulation )

    Hi All, I am new to BPS . please give me some Information for the following. 1. What is the use of BPS with BW. 2. Any good Document available on the net for the beginner like me.( If any Document is there plz give me the link ) 3. What is the need o

  • Need to turn off Password protection

    I was just exploring and set a password and now I need to turn off the password. When I go to the Password page it is "Enabled." How do I disable this?

  • Avi files & Premiere Pro CS3

    I just picked up one of those little Flip Ultras. They produce avi files and the documentation and support from Flip says that dvds can be created in third party software by importing the avi files. So I did that with my CS3 version ... nada. I see l

  • HLS-VOD stream slow....?

    took Lynda course and built a page "universal player" to try flash first, then go to the m3u8 stream, and then try android files lastely; Publishing an on-demand stream with a universal player code Encoded an 8 second video F4V 800kbps and then all t