Transaction boundary(demarcation) in Servlet

Hello, pls provide information on this:
In session bean, we can define the transaction boundary like this:
UserTransaction ut = sessionContext.getUserTransaction();
ut.begin();
//some coding here.......
ut.commit();
Can i do this in servlet and jsp? If can, do i need to configure the server's environment?

Then, what i should do i if want to define the transaction boundary in servlet/jsp?
Is there any way to do this?

Similar Messages

  • The cache's transaction boundary for db cacheStore

    Hi !
    I implement a CacheStore interface to cache db data,when I use cache.put() , the value can be persist into db,it's a statement level transaction, how can i control a code fragment's transaction boundary
    such as:
    cache.put(key1,value1);
    cache.put(key2,value2);
    when the last operation fail the first operation can be rollback by theory, the conclusion the other question is the cache.storeAll is handled by multi-thread , the some values has persited into db ,but one fail ,it's violates business's atomicity ,how can handle this situation?

    Hi Stephen,
    You can do the cache operations as a part of a single transaction by using a transactional cache. Something like ...
    Connection conn =  new DefaultConnectionFactory().createConnection();
    OptimisticNamedCache cache1 = conn.getNamedCache("tx-cache1");
    OptimisticNamedCache cache2 = conn.getNamedCache("tx-cache2");
    OptimisticNamedCache cache3 = conn.getNamedCache("tx-cache3");
    conn.setAutoCommit(false);
    cache1.insert(key1, value1);
    cache2.insert(key2, value2);
    cache3.remove(key3);
    conn.commit();You are correct that you cannot currently use write-behind with a transactional cache. I'm not sure of your requirements but if you don't need the database updates to be part of the transaction then you could possibly do something by registering a MapListener with the transactional caches. Events occur on the transactional cache at commit time.
    Another thing to keep in mind is that there are some other limitations with transactional caches and there is a performance cost. See the documentation for more details.
    Thanks,
    Tom

  • How can I get an exist applicationModule reference in a servlet?

    JDev 9.0.3.5
    Purpose: to get an exist ADF applicationModule reference in a servlet, so can keep data operations in the same db transaction.
    here is the servlet side code, seems not work.
    ApplicationModuleRef appModRef = SessionUtils.getAmRefFromRequest(request, APPLICATION_ID, "demo.HelloAMLocal");
    return appModRef.useApplicationModule(false);
    package demo;
    import java.util.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.JboException;
    import oracle.jbo.common.ampool.ApplicationModuleRef;
    import oracle.jbo.common.ampool.SessionCookie;
    import oracle.jbo.http.HttpContainer;
    import oracle.jbo.http.HttpSessionCookieFactory;
    import oracle.jbo.http.HttpUtil;
    public class SessionUtils {
    public static ApplicationModuleRef getAmRefFromRequest(HttpServletRequest inRequest,
    String inAppId,
    String inConfigName) {
    initialize(inRequest, inAppId, inConfigName);
    HttpContainer container = HttpContainer.getInstanceFromSession(inRequest.getSession());
    ApplicationModuleRef amRef = (ApplicationModuleRef)container.getSessionCookie(inAppId);
    if (amRef == null) {
    //throw new JboException(Res.format(Res.COOKIE_NOT_FOUND, inAppId));
    throw new JboException("Cookie not found when get am ref.");
    return amRef;
    public static void initialize(HttpServletRequest request,
    String appId,
    String configName) {
    int index = configName.lastIndexOf('.');
    String configPackage = configName.substring(0, index);
    String configSection = configName.substring(index + 1);
    // This instantiates an HttpContainer, and attaches the request app mod cookie to the
    // container.
    SessionCookie cookie = findSessionCookie(request,
    request.getSession(true),
    appId,
    configPackage,
    configSection);
    ApplicationModule am = cookie.useApplicationModule(); //no lock
    Locale locale = HttpUtil.determineLocale(request);
    // setup the Application Module's Locale based on the incoming request information
    if(locale != null)
    am.getSession().setLocale(locale);
    // keep id for passivation purposes. This inserts a record into the PS_TXN table.
    cookie.reservePassivationId();
    } // initialize
    protected static SessionCookie findSessionCookie(HttpServletRequest request
    , HttpSession session
    , String applicationId
    , String configPackage
    , String configName) {
    // Load the pool creation properties with the name of our custom
    // application pool class.
    Properties cookieProps = new Properties();
    cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request);
    // Specify property values to be used by the application pool. Please note
    // that these property values could also have been specified in the
    // application configuration file.
    Properties poolProps = new Properties();
    // This action instantiates an HttpContainer.
    SessionCookie cookie = HttpContainer.findSessionCookie(session
    , applicationId
    , configName // poolName
    , configPackage
    , configName
    , poolProps
    , cookieProps);
    return cookie;
    }

    Example VI
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Seperate variables.vi ‏8 KB

  • Error: Invalid element 'servlet' in content of 'web-app'

    Hi,
    I m working on a project that includes JSPs, whenever I wanna add JSP to my project it shows following compilation error:
    Invalid element 'servlet' in content of 'web-app', expected elements '[error-page, taglib, resource-env-ref, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref, ejb-local-ref]'
    I have thoroughly checked the web.xml. It is perfectly alright. It is as follows:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>myServlet</servlet-name>
    <servlet-class>com.project.MainServlet</servlet-class>
    <init-param>
    Long postings are being truncated to ~1 kB at this time.

    The Complete web.xml is as follows:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>montana</servlet-name>
    <servlet-class>com.masstech.montana.boundary.uii.MainServlet</servlet-class>
    <init-param>
    <param-name>db</param-name>
    <param-value>MontanaDS</param-value>
    </init-param>
    <init-param>
    <param-name>user</param-name>
    <param-value>MS</param-value>
    </init-param>
    <init-param>
    <param-name>password</param-name>
    <param-value>MS</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-n[i]Long postings are being truncated to ~1 kB at this time.

  • Use of ThreadLocal in EJB to store Transaction id

    Hi ,
    I my application we need to retain the transaction id for logging . We had a facade layer which are stateless session beans . We use an EJB interceptor to get the transaction id from the request object and put it in a threadlocal . We retrive the transaction id when we log . We have done some POC and it works well .
    In some cases we have call to local ejbs to demarcate the transaction boundary , for the local ebjs we call the other helper classes . Just wanted to know if the transaction id can still be retrieved from the helper classes . Any help would be highly appreciated .
    Thanks,
    Tirthankar

    Hello Roberto,
    1) Yes, but we anticipated this performance issue by switching to an external Content Server. I also remember one performance issue: when you are uploading an attachement in your session, the system will store it in a temporary table BBP_TRANSCONTENT (the content is not stored in memory). It will be definitively stored in BBPCONT only if the user saves the purchasing document (otherwise we pollute the final table).
    2) You have to "migrate" old documents from BBPCONT to the new Content Repository (ex:Content Server). There is a report for that : RSIRPIRL.
    Rgds
    Christophe

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

  • OSB Dynamic service call or dynamic route and transactions

    Hello,
    I've got the following problem in my OSB architecture for asynchronous incomming services.
    OSB version is 10.3.1
    ConnectionFactory is XA
    Problem domain:
    Dynamic service call or dynamic route within transaction boundary
    Elements within transaction:
    1.     JMS Queue ->
    2.     Upper Proxy Service (De-queue) ->
    3.     Lower Proxy Service (Canonical Service) ->
    4.     Business Service (Data Service) ->
    5.     Database Adapter->
    6.     Database
    Dynamic element
    Upper Proxy Service (De-Queue) must be able to determine which Lower Proxy Service (Canonical Service) has to be called on the basis of the message taken from the JMS Queue without losing the transaction (this doesn’t work yet).
    Already tried possible solutions:
    •     Make a service call dynamic by setting the $inbound name attribute. This results in a this property is read-only error.
    •     Use a Dynamic route instead of a service-call. This results in a loss of transaction. The message is deleted from the Queue without taking failure or success into account.
    •     Use a Dynamic route with a quality of service set to exactly once in the header. This seems to be ignored, results in a loss of transaction.
    •     Use a Dynamic route with an explicit reply with failure for errors. Results in a loss of transaction.
    •     Use a Dynamic Publish. This doesn’t fit the required flow because it has no response.
    I hope someone can shed some light on this because I'm at a total loss. I found some references in the forum to what seems to be the same problem but without definite answers. A work-around is also a viable answer.
    Regards,
    Bas Mul

    Hi,
    I'll try to clarify.
    Upper proxy dequeues a message.
    Depending on a value of a specific tag within the message a canonical proxy service (out of 5 at the moment but this numer could increase) has to be called (and be dynamic transform transformed to the format of the specific canonical).
    The canonical service must then pass the message to a database adaper's business service which is responsible for the database insert/update/read.
    If something in the chain from dequeue to database action goes wrong the message may not dissapear from the queue.
    Somehow a dynamic route in the message flow between dequeue proxy and canonical proxy breaks the transaction.
    Bas

  • EJB transaction isolation not working

    I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB test application
    with no success so far.
    The environment is Windows NT, WebLogic 6.1, Informix DB (which, according to
    its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx Data Source on
    a JDBC pool.
    I have an CMP Entity EJB with the following definitions:
    <container-transaction>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <transaction-isolation>
    <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    The entity EJB is used by a servlet that uses JTA to establish a transaction that
    the EJB methods should share ("Required" transaction attribute). The servlet is
    as follows:
    // Establish a transaction
    UserTransaction trn =
    (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    trn.begin();
    trn.setTransactionTimeout(20);
    // Get the EJB
    SdrFA fFA = home.findByPrimaryKey( fFAPK );
    // Update an attribute
    fFA.setSomeAtt("someData");
    // Sleep to control concurrency
    Thread.currentThread().sleep(t * 1000);
    // commit
    trn.commit();
    I expected this setup to prevent concurrent updates and even accesses to the same
    DB table row, but this is not the case: when I invoke the servlet from a session
    and then invoke it again from another session while the first one is sleeping,
    the second one completes all right and is visible in the DB before the first one
    commits.
    Just in case TRANSACTION_SERIALIZABLE is not supported after all, I tried TRANSACTION_REPEATABLE_READ
    instead whith the same results.
    Is there something I'm missing, or any error in my setup?
    Thanks for any suggestion,
    Pere Torrodellas

    Hi Pere,
    AFAIR delay-updates-until-end-of-tx is set to True by default, so the
    actual update is not issued untill TX is commited. I'd try setting it to
    false and running the test again.
    Here are some documentation references:
    http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1048164
    http://e-docs.bea.com/wls/docs61/ConsoleHelp/wls_ejb_jar_dtd.html
    Regards,
    Slava Imeshev
    "Pere Torrodellas" <[email protected]> wrote in message
    news:[email protected]...
    >
    I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB testapplication
    with no success so far.
    The environment is Windows NT, WebLogic 6.1, Informix DB (which, accordingto
    its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx DataSource on
    a JDBC pool.
    I have an CMP Entity EJB with the following definitions:
    <container-transaction>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <transaction-isolation>
    <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>SdrFA</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    </transaction-isolation>
    The entity EJB is used by a servlet that uses JTA to establish atransaction that
    the EJB methods should share ("Required" transaction attribute). Theservlet is
    as follows:
    // Establish a transaction
    UserTransaction trn =
    (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    trn.begin();
    trn.setTransactionTimeout(20);
    // Get the EJB
    SdrFA fFA = home.findByPrimaryKey( fFAPK );
    // Update an attribute
    fFA.setSomeAtt("someData");
    // Sleep to control concurrency
    Thread.currentThread().sleep(t * 1000);
    // commit
    trn.commit();
    I expected this setup to prevent concurrent updates and even accesses tothe same
    DB table row, but this is not the case: when I invoke the servlet from asession
    and then invoke it again from another session while the first one issleeping,
    the second one completes all right and is visible in the DB before thefirst one
    commits.
    Just in case TRANSACTION_SERIALIZABLE is not supported after all, I triedTRANSACTION_REPEATABLE_READ
    instead whith the same results.
    Is there something I'm missing, or any error in my setup?
    Thanks for any suggestion,
    Pere Torrodellas

  • Servlet: "WebServiceServlet" failed to preload on startup in webapp: "resourcemgr.war"

    HI,
    I Have deployed my webservice on Wl7.0 but when the App server boots it gives
    me the following exception. Does any body has any idea why it is happening like
    that. Though i have not tried to access my webservice opeartaions using any client
    but it should not have happened as i have deployed similar webservices on WL7.0.
    may be something is wrong with this but i am not able to figure it out.
    Exception coming is..........
    javax.servlet.ServletException: com/sds/services/transaction/ResourceMgr
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:912)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:833)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:773)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:2763)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:2708)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:2681)
    at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:552)
    at weblogic.servlet.internal.WebService.preloadResources(WebService.java:476)
    at weblogic.t3.srvr.ServletInitRunner$1.run(ServletInitRunner.java:50)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
    at weblogic.t3.srvr.ServletInitRunner.run(ServletInitRunner.java:46)
    at java.lang.Thread.run(Thread.java:479)
    Thanks & Regards
    Akhil Nagpal

    Hi,
    Do you use a base-interface for your bean? I had the same problem with a
    session bean that uses
    a business interface, which is the base interface for the remote interface
    and implemented by the bean.
    I don't know what exactly happened, but when I do not use the business
    interface then it works. Seems
    to be a problem with the generator. Surprisingly it also works if the remote
    interface is empty (and does not
    add any methods or specialize the derived methods from the business
    interface).
    Hope this helps.
    Regards
    Thomas
    "Akhil Nagpal" <[email protected]> wrote in message
    news:[email protected]...
    >
    HI,
    I Have deployed my webservice on Wl7.0 but when the App server boots itgives
    me the following exception. Does any body has any idea why it is happeninglike
    that. Though i have not tried to access my webservice opeartaions usingany client
    but it should not have happened as i have deployed similar webservices onWL7.0.
    may be something is wrong with this but i am not able to figure it out.
    Exception coming is..........
    javax.servlet.ServletException: com/sds/services/transaction/ResourceMgr
    atweblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
    :912)
    atweblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
    va:833)
    atweblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
    a:773)
    atweblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletC
    ontext.java:2763)
    atweblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServlet
    Context.java:2708)
    atweblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServle
    tContext.java:2681)
    atweblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:552)
    atweblogic.servlet.internal.WebService.preloadResources(WebService.java:476)
    atweblogic.t3.srvr.ServletInitRunner$1.run(ServletInitRunner.java:50)
    atweblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:744)
    atweblogic.t3.srvr.ServletInitRunner.run(ServletInitRunner.java:46)
    at java.lang.Thread.run(Thread.java:479)
    Thanks & Regards
    Akhil Nagpal

  • Mutilple calls in one transaction - what's the best way?

    I need a session bean to perform following functionality (rought each one
    corresponds to a method)
    - update customer profile (name, address, etc., they are in one table)
    - update customer's services
    - update customer's phone book (they are in separate table)
    The bottom line is, I want to give max flexibility to calling clients so
    they can choose to perform any combination of the functionality, yet still
    do all that in one transaction.
    I could:
    a. make the bean a stateful session bean, make 2 methods, one to start
    transaction and one to commit/rollback it, and let the servlet call them,
    and call any update method in between. (guess i have to use bean-managed
    transaction)
    b. make the bean stateless and container-managed transaction (marked
    required/support), let the servet start userTransaction, and call the bean
    methods passing the state (i.e. account#).
    I tend to think <b> is the better way, <a> is not recommended according to
    WLS documentation.
    Any other better way?
    thanks

    Take a look at the session facade pattern. It is like your b. version but
    with an extra class that handles the transaction separated from the servlet.
    // Björn Caroll
    "Alan Tang" <[email protected]> wrote in message
    news:[email protected]..
    I need a session bean to perform following functionality (rought each one
    corresponds to a method)
    - update customer profile (name, address, etc., they are in one table)
    - update customer's services
    - update customer's phone book (they are in separate table)
    The bottom line is, I want to give max flexibility to calling clients so
    they can choose to perform any combination of the functionality, yet still
    do all that in one transaction.
    I could:
    a. make the bean a stateful session bean, make 2 methods, one to start
    transaction and one to commit/rollback it, and let the servlet call them,
    and call any update method in between. (guess i have to use bean-managed
    transaction)
    b. make the bean stateless and container-managed transaction (marked
    required/support), let the servet start userTransaction, and call the bean
    methods passing the state (i.e. account#).
    I tend to think <b> is the better way, <a> is not recommended according to
    WLS documentation.
    Any other better way?
    thanks

  • Transaction Support for message broker channel

    Hi all,
    I have created a JPD and subscribing to an MB channel and listening for messages, suppose the message is delivered to the JPD i.e onMessage is invoked successfully, but at the next node there is an exception thrown, so I want to rollback all the stuff done and also pushback the message to the channel, (and if possible get the message back to the JPD by retrying the entire tranaction).
    1. Can the message be pushed back to the channel?
    2. Will the channel try to send the same message again to the JPD incase we rollback and wait again at onMessage in the same JPD by means of exceptional path (retry count)?
    3. Is the message available for consumption for other subscribers incase we are able to pushback the message to the channel?
    4. Bottomline - How can I include the MB channel(message delivery) within transactional boundary?
    TIA
    Abhishek

    Hi kai/All,
    Thanks for ur response, but I still have some questions.
    1. If the message is not going to be pushed back to the channel, what exactly do we mean by "retry"(is it that I have to resubscribe(and wait at onMessage call in my subscriber jpd) to the channel, and wait for the same message to be pusblished by the publisher JPD)?
    Also my requirement is - I am having number of subscriber(JPD instances say workflow JPDs) to the same channel and using filters to deliver the message to the appropriate workflow JPD instance, So, One and only one instance can listen for a particular message, so incase there is an exception in a particular workflow JPD, no other instance can cover for it beacuse of a particualr filter value for the message subscription. How can I overcome this shortcoming?
    TIA
    Abhishek

  • Transactional Context Propagation

    Hi,
              Suppose that I a statefull session bean that uses a helper class to delegate
              its business methods. If the transactions are demarcated from the container
              will the transactional context of the caller (of the helper class) method be
              propagated to the helper class?
              Thank you in advance
              

              Hi,
              Is this true also for BMT? I have a problem where the UserTransaction
              object seems not to propagate from one BMT bean to another BMT bean.
              At least the status of the transaction
              (as retrieved by this.sessionContext.getUserTransaction().getStatus())
              is Status.STATUS_NO_TRANSACTION when checked in the method of th called bean.
              regards - Johan
              "Cameron Purdy" <[email protected]> wrote:
              >The transaction is bound to the thread, so yes, under most ordinary
              >conditions, the context would also apply to (or more likely through)
              >methods
              >of other classes called. Example: EJB A calls helper class method HC.foo()
              >calls HC.foo2() calls EJB B. If EJB A were in a transaction, EJB B would
              >be
              >in the same.
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol, Inc.
              >http://www.tangosol.com
              >Tangosol Server: Enabling enterprise application customization
              >
              >
              >"Routis Haralampos" <[email protected]> wrote in message
              >news:[email protected]...
              >> Hi,
              >> Suppose that I a statefull session bean that uses a helper class to
              >delegate
              >> its business methods. If the transactions are demarcated from the
              >container
              >> will the transactional context of the caller (of the helper class)
              >method
              >be
              >> propagated to the helper class?
              >> Thank you in advance
              >>
              >>
              >
              >
              

  • Design on handling servlet request

    Hi,
    I have a servlet which will get request to execute a service.
    What is the best way to design this component to cater for high transactions?
    Once the servlet gets request, it needs to store the data to the database first and then execute the service.
    Shall I create a new thread for each of the request? Beside this way, what other better ways which I can follow?
    If I do everthing in that particular servlet, will it be a bad design?
    Are there any design pattern which I can apply?
    Thank you.
    Any sharing will be appreciated.

    Hi,
    I have a servlet which will get request to execute a
    service.
    What is the best way to design this component to cater
    for high transactions?IMHO it's difficult to say, but for instance you should use object pooling, in your case connection pooling. Depending on your business classes, for persistence I would have a look at O/R tools like Hibernate. Hibernate does internal caching as well.
    >
    Once the servlet gets request, it needs to store the
    data to the database first and then execute the
    service.
    Shall I create a new thread for each of the request?
    Beside this way, what other better ways which I can
    follow?As far as I know and I do it, each request is handled by its own thread, so there is no need to start a thread on each request. The only problem is if you have class member variables or static variables because different requests change those variables depending on your business logic. So either make those variables synchronized (which makes each access to those variables even slower) or better do not use member variables whenever possible. Handle the business within a method.
    >
    If I do everthing in that particular servlet, will it
    be a bad design?Yes, I'd say so.
    >
    Are there any design pattern which I can apply?Have a look at the FrontController Pattern for the servlet. And the Facade Pattern for the business logic. You'll find these patterns online too, google for "J2EE patterns FrontController". You should end up at a SUN Site.
    Other relevant patterns are explained too.
    >
    Thank you.
    Any sharing will be appreciated.

  • Updating CMS Node properties not working

    I have a pageflow controller that is fetching a node from the content
    management server, and updating a property on it. However, this value change
    is not being persisted... the next time I load the node the old value is
    still there and the modified time has not been changed.
    Does the proper way to modify node metadata differ from the following????
    NodeOps nodeOps = repManager.getNodeOps();
    ID nodeID = new ID(repName,nodeUID);
    Node node = nodeOps.getNode(nodeID);
    Property currentProperty = currentProperty =
    currentNode.getProperty("mymetadatatitle");
    currentProperty.setValue(new Value("newStringValue"));
    I have also tried using:
    nodeOps.renameNode(nodeID,newName);
    ... which is also not persisting any changes. I have verified that the
    incoming values reflect the changed values I would like to persist.
    Is there some kind of transaction boundary that I'm not aware of, and a
    transaction possibly rolling back? I don't see any errors or exception being
    thrown and am stumped....
    thanks!
    Markus

    Ahhhhhhh... I'm sure that'll solve it... thanks!
    Markus
    "Gregory Smith" <[email protected]> wrote in message
    news:[email protected]...
    The Property object is just a value object, so updating it does not
    trigger a save.
    Try this after your code:
    node = nodeOps.updateProperties(node.getId(),
    node.getProperties());
    The returning Node should have the updated properties, as well, plus
    anyother side effects from the save.
    I'm not sure why renameNode() isn't persisting anything in the database
    tables, without more information. Node is also a value object, so just
    calling renameNode() won't modify the node instance you have unless you
    reassign from the return value (e.g. node =
    nodeOps.renameNode(node.getId(), newName)). However, just the call
    should update the database once the transaction is finished. And, if
    you're not creating an outer transaction somewhere (i.e. in the
    jsp/servlet/jpf, or at an EJB boundary), then a transaction gets created
    and comitted entirely within the call to renameNode().
    Greg
    Markus Blumrich wrote:
    I have a pageflow controller that is fetching a node from the content
    management server, and updating a property on it. However, this value
    change
    is not being persisted... the next time I load the node the old value is
    still there and the modified time has not been changed.
    Does the proper way to modify node metadata differ from thefollowing????
    >>
    NodeOps nodeOps = repManager.getNodeOps();
    ID nodeID = new ID(repName,nodeUID);
    Node node = nodeOps.getNode(nodeID);
    Property currentProperty = currentProperty =
    currentNode.getProperty("mymetadatatitle");
    currentProperty.setValue(new Value("newStringValue"));
    I have also tried using:
    nodeOps.renameNode(nodeID,newName);
    ... which is also not persisting any changes. I have verified that the
    incoming values reflect the changed values I would like to persist.
    Is there some kind of transaction boundary that I'm not aware of, and a
    transaction possibly rolling back? I don't see any errors or exceptionbeing
    thrown and am stumped....
    thanks!
    Markus

  • New error with upgrade jboss/tomcat: "Connection handle has been closed and is unusable"

    Hi,
    This error suddenly appeared when we upgraded from jboss3/tomcat5.0 to jboss4.2/tomcat5.5.
    here's the usecase:
    1) User clicks on report link
    2) Crystal reports web componnent displays screen to fill in report parameters.
    3) user enters parameters and clicks submit
    4) System throws Exception
    The same reports worked fine with jboss 3.2.6/tomcat 5.0. We haven't touched anything in this realm.
    Log Excerpt:
    09:42:18,842 INFO  [datasource] Openning rowset
    09:42:18,904 ERROR [reportdefinition] com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Connection handle has been closed and is unusable
    09:42:18,905 ERROR [datasource] Failed to open rowset: the query failed to open rowset
    com.crystaldecisions.reports.reportdefinition.datainterface.g: JDBC Error: Connection handle has been closed and is unusable
         at com.crystaldecisions.reports.reportdefinition.datainterface.d.a(Unknown Source)
    To try to narrow down the problem, I've updated the jdbc configuration to
         <track-statements>true</track-statements>   
    here's a recap:
    This Boolean element specifies whether to check for unclosed statements when a connection is returned to the pool. If it is true, a warning message is issued for each unclosed statement. If the log4j category org.jboss.resource.adapter.jdbc.WrappedConnection has trace level enabled, a stack trace of the connection close call is logged as well. This is a debug feature that can be turned off in production.
    Interestingly enough, this error appears slightly upstream:
    (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at
    org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown
    So the question arises:
    1) Is the jboss datasource overly/aggressively closing result sets?
    2) or is there a coding error in CRXIR2?
    thanks,
    bill
    Full stack trace:
    [2008-03-13 17:26:18,905] [INFO ] org.jboss.resource.connectionmanager.CachedConnectionManager (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
         at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.z.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ak.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ad.int(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bk.for(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(Unknown Source)
         at com.crystaldecisions.reports.sdk.DatabaseController.setTableLocation(Unknown Source)
         at org.apache.jsp.reports.processreport_jsp.switchTables(processreport_jsp.java:131)
         at org.apache.jsp.reports.processreport_jsp.loadReport(processreport_jsp.java:68)
         at org.apache.jsp.reports.processreport_jsp._jspService(processreport_jsp.java:227)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.shared.pagecache.client.PageCacheFilter.doFilter(PageCacheFilter.java:760)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.ExpiredPasswordFilter.doFilter(ExpiredPasswordFilter.java:92)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.processUrl(ChannelUrlFilter.java:168)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.doFilter(ChannelUrlFilter.java:100)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.BlockIpAddressFilter.doFilter(BlockIpAddressFilter.java:224)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.outstart.multiapp.filters.KeepOtherSessionsAliveFilter.doFilter(KeepOtherSessionsAliveFilter.java:88)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)

    <p>
    OK. I found the problem along with a workaround.
    </p>
    <p>
    <strong>The problem:</strong>
    </p>
    <p>
    a programming practice clashes with a new jboss 'safety check'.
    </p>
    <p>
    <strong>Programming practice:</strong>
    </p>
    <p>
    crystal reports gets a database connection in one jsp page, then tries to use it on another jsp/servlet
    </p>
    <p>
    <strong>Jboss safety check:</strong>
    Jboss/tomcat new comes configured out-of-the-box with a 'cached connection
    manager', which
    </p>
    <p>
    "Check[s] for unclosed connections and transaction terminated checks in servlets/jsps."
    </p>
    <p>
    <strong> Summary</strong>
    </p>
    <p>
    In short, if a servlet/jsp ends and it leaves a database connection open, Jboss will automatically close it.
    </p>
    <p>
    </p>
    <p>
    <strong>Workaround:</strong><br />
    Comment out two entries in these two files:
    </p>
    <p>
    1) conf/jboss4/pe/deploy/jboss-web.deployer/server.xml
    </p>
    <p>
    2) conf/jboss4/pe/deploy/jboss-web.deployer/META-INF/jboss-service.xml
    </p>
    <p>
    The two entries:
    </p>
    <p>
    </p>
    <p>
    1)
    </p>
    <p>
                 <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"<br />
                    cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"<br />
                    transactionManagerObjectName="jboss:service=TransactionManager" /><br />
    </p>
    <p>
    2)
    </p>
    <p>
          <depends>jboss.jca:service=CachedConnectionManager</depends><br />
    </p>
    <p>
    </p>
    <p>
    <strong>Comments on the workaround</strong>
    </p>
    <p>
    The 'cached connection manager' basically makes sure that the application cleans up after bad programmers. It seems most helpful in development, load testing, or trouble shooting.
    </p>
    <p>
    In production,  you can likely  comment them out with minimal
    impact on the application.
    </p>

Maybe you are looking for

  • OIM 91 Installation Problem on Linux

    Hi, I had installed SOA-Oracle Application Server 10.1.3.3 and tried installing the Oracle Identity Manager in Linux machine, but at the end of installing the Oracle Identity Manager it was throwing an error like +"*Oracle Identity Manager found that

  • XY graphing with large amount of data

    I was looking into graphing a fairly substantial amount of data.  It is bursted across serial. What I have is 30 values corresponding to remote data sensors.  The data for each comes across together, so I have no problem having the data grouped.  It

  • Pages not Loading-HELP! Going crazy here!

    I cannot figure this out to save my life. I cannot create a link that works from one page to the next. I mean the link works but you don't see anything. The page comes up black. On the Highlight page you can hear the film playing in the back but can'

  • Hi I've done An update on my iphone5 today and some how it's got stuck in recovery mode how do I get out of it

    Hi I've just done the new up date to my iPhone, and it's now gone into recovery mode and is telling be to restore phone how do I do this

  • Battery doesn't finish

    i reported a problem earlier in a previous post about my defective battery, as i said, it used to drain by itself after shutting down, and it only lasts maybe 45mins max. Well, the problem now is the battery doesn't seem to finish, i've been using it