Maintaining Transaction Across Multiple JSP Pages

          Hi,
          I have a multi page Registration (3 steps). On each step data submited is taken
          to the database via an EJB component (Session Bean). How do I maintain a transaction
          across these JSP pages so that the data in the database is consistent. If a there
          is a problem in the 3rd step the data submitted in the first two steps should
          be rolled back.
          How do I maintain transaction across multiple pages.
          Regards
          -MohanRaj
          

It will take from several minutes to a long time for a user to complete a multiple page registration process. Do you really have enough database connections that each concurrent user can hold on to one?
Usually you cannot open more than 50-200 connections to a database at any given time.
Remember that some users will abandon the registration process. Can you afford that their sessions holds a db conenction until the session times out?
Consider changing your datamodel so you can run and commit a transaction at the end of processing the form data from a page. Immediately after the commit give the db connection back to the pool inside the app. server.
It can be as simple as having a column in the database of type enum, with a set of values that shows how far in the registration process the registration has procesed.
BTW. if you absolutely have to hold on to the db connection, you can stuff it into a session scoped attribute and it will be available on all pages.

Similar Messages

  • Maintaining Transactions Across JSP Pages

    Hi,
    I have a multi page Registration (3 steps). On each step data submitted is taken
    to the database via an EJB component (Session Bean). How do I maintain a transaction
    across these JSP pages (i.e. either in the EJB or in the jsp) so that the data
    in the database is consistent? So if there is a problem in the 3rd step the data
    submitted in the first two steps should be rolled back.
    Can I use a statefull session beans, which will maintain a database connection
    created during the first step, so that I can use the same connection for steps
    2 & 3. In the first step after getting the database connection I will begin a
    transaction and insert the first part of the data, then this connection will be
    maintained by the statefull session and used for steps 2 & 3. At the end I will
    commit the transaction. Will this work?
    How do I maintain transaction across multiple pages? Is there is any standards
    for this scenario where the transaction is maintained across multiple pages. I
    cannot carry data across the jsp pages because of the complex data collected.
    Any help appreciated.
    Regards
    -MohanRaj

    You can not and should not do it the way that you are proposing. Keeping a transaction
    open across any interaction with the user is a big mistake. Transactions are scarce
    resources. They need to be short. You will need to collect the data from the three
    pages in the servlet itself. You can use the HTTPSession, or hidden fields in
    the forms. Only after all of the data is collected should you begin a transaction
    and update the database. Alternatively, you could store the partial data in a
    temporary database table, and move it to a permanent table when all of the data
    has been provided.

  • Using ATMI and tuxedo to institue distributed transactions across multiple DBs

    I am creating the framework for a given application that needs to ensure that data
    integrity is maintained spanning multiple databases not necessarily within an
    instance of weblogic. In other words, I need to basically have 2 phase commit
    "internet transactions" between a given coordinator and n participants without
    having any real knowlegde of their internal system.
    Originally I was thinking of using Weblogic but it appears that I may need to
    have all my particular data stores registered with my weblogic instance. This
    cannot be the case as I will not have access to that information for the other
    participating sytems.
    I next thought I would write my own TP...ouch. Everytime I get through another
    iteration I kept hitting the same issue of falling into an infinite loop trying
    to ensure that my coordinator and the set of participants were each able to perform
    the directed action.
    My next attempt has led me to the world of ATMI. Would ATMI be able to help me
    here. Granted I am using JAVA so I am assuming that I would have to use CORBA
    to make the calls but will ATMI enable me to truly manage and create distributed
    transactions across multiple databases. Please, any advice at all would be greatly
    appreciated.
    Thanks
    Chris

    Andy
    I will not have multiple instances of weblogic as I cannot enfore that
    the other participants involved in the transaction have weblogic as
    their application server. That being said, I may not have the choice
    but to use WTC.
    Does this make more sense?
    Andy Piper <[email protected]> wrote in message news:<[email protected]>...
    "Chris" <[email protected]> writes:
    I am creating the framework for a given application that needs to ensure that data
    integrity is maintained spanning multiple databases not necessarily within an
    instance of weblogic. In other words, I need to basically have 2 phase commit
    "internet transactions" between a given coordinator and n participants without
    having any real knowlegde of their internal system.
    Originally I was thinking of using Weblogic but it appears that I may need to
    have all my particular data stores registered with my weblogic instance. This
    cannot be the case as I will not have access to that information for the other
    participating sytems.I don't really understand this. From 6.0 onwards you can do 2PC
    between weblogic instances, so as long as the things you are calling
    are transaction (EJBs for instance) it should all work out fine.
    I next thought I would write my own TP...ouch. Everytime I get through another
    iteration I kept hitting the same issue of falling into an infinite loop trying
    to ensure that my coordinator and the set of participants were each able to perform
    the directed action.
    My next attempt has led me to the world of ATMI. Would ATMI be able to help me
    here. Granted I am using JAVA so I am assuming that I would have to use CORBA
    to make the calls but will ATMI enable me to truly manage and create distributed
    transactions across multiple databases. Please, any advice at all would be greatly
    appreciated.I don't see that ATMI would give you anything different. Transaction
    management Tux is fairly similar to WebLogic (it was written by the
    same people). If you are trying to do interposed transactions
    (i.e. multiple co-ordinators) then WTC would give you this but it is
    only a beta feature in WLS 6.1. Using Tux domain gateways would also
    give you interposed behaviour but would require you write your servers
    in C or C++ ....
    andy

  • Using ATMI and tuxedo for distrubuted transactions across multiple DBs

              I am creating the framework for a given application that needs to ensure that data
              integrity is maintained spanning multiple databases not necessarily within an
              instance of weblogic. In other words, I need to basically have 2 phase commit
              "internet transactions" between a given coordinator and n participants without
              having any real knowlegde of their internal system.
              Originally I was thinking of using Weblogic but it appears that I may need to
              have all my particular data stores registered with my weblogic instance. This
              cannot be the case as I will not have access to that information for the other
              participating sytems.
              I next thought I would write my own TP...ouch. Everytime I get through another
              iteration I kept hitting the same issue of falling into an infinite loop trying
              to ensure that my coordinator and the set of participants were each able to perform
              the directed action.
              My next attempt has led me to the world of ATMI. Would ATMI be able to help me
              here. Granted I am using JAVA so I am assuming that I would have to use CORBA
              to make the calls but will ATMI enable me to truly manage and create distributed
              transactions across multiple databases. Please, any advice at all would be greatly
              appreciated.
              Thanks
              Chris
              

              I am creating the framework for a given application that needs to ensure that data
              integrity is maintained spanning multiple databases not necessarily within an
              instance of weblogic. In other words, I need to basically have 2 phase commit
              "internet transactions" between a given coordinator and n participants without
              having any real knowlegde of their internal system.
              Originally I was thinking of using Weblogic but it appears that I may need to
              have all my particular data stores registered with my weblogic instance. This
              cannot be the case as I will not have access to that information for the other
              participating sytems.
              I next thought I would write my own TP...ouch. Everytime I get through another
              iteration I kept hitting the same issue of falling into an infinite loop trying
              to ensure that my coordinator and the set of participants were each able to perform
              the directed action.
              My next attempt has led me to the world of ATMI. Would ATMI be able to help me
              here. Granted I am using JAVA so I am assuming that I would have to use CORBA
              to make the calls but will ATMI enable me to truly manage and create distributed
              transactions across multiple databases. Please, any advice at all would be greatly
              appreciated.
              Thanks
              Chris
              

  • The best  way of carrying the search string across different jsp pages?

    I heard about transfer object. What about carrying object with session for different pages.
    Please suggest me the best approach to
    carry the search string across different jsp pages?
    thanks
    vijendra

    I doubt its possible even with a fancy HTML widget, although the last iBA update now allows links to other books.

  • MAintain session across multiple DB Adapters.

    Hi,
    I am using a BPEL process which has multiple DB Adapters.
    As far as I understand each DB Adapter call from BPEL is a different session.
    Is there any way to maintain a same session across multiple DB Adapter calls i.e to make multiple DB calls in the same session?
    thanks,
    CD

    Yes this is supported.
    You'll have to take a look at the support for XA (distributed transactions).
    See this thread for some good links to other info.
    Re: DB Rollback Questions for 10.1.3.1 and 10.1.3.3

  • Redirecting across 2 jsp pages in 2 different servers

    hi, can anyone tell me if i can use redirect to automatically link from a page on 1 server to a page in another server, or is there some security concerns that will prevent the redirect function from working across 2 servers? thanks.

    oh thanks but can i pass a parameter to the jsp page residing in another server using redirect? e.g.
    response.sendRedirect("http://www.anotherserverpage.jsp?valuetopass=10");
    will i be able to use Response.getParameter in the page residing in the other server?

  • Using a Statefull Session Bean with RMI on Multiple JSP pages

    Heya all,
    i have a JBoss server running with a statefull bean on it. I want to use it on my JSP pages. But every time I start my JSP-page a NEW INSTANTION of the bean is created! For each user using my page, I want ONE bean.
    Is there anyway to do this? ANything with the sessioncontext?
    I can do it with local beans, using the simple tags in the JSP-page, but they do not work for Remote Beans.
    (I use JNDI)

    hi,
    statefull session beans are client session specific. the instance will exists if client session exits.
    now since u are loading the jsp page again in the other browser, a new instance will be associated with the current session.
    hope it will work.
    sameer

  • To combine a multiple jsp pages in a one single page

    hi all,
    my problem statement is, i have 5 tabbed panes i,e each in a jsp page i need to put all those information into one single jsp page...while submiting the data. so how can i do about this using jsp.
    regards
    geetha

    The use of frames is highly discouraged (as is the use of scriptlets). So don't even think about it.
    You can just include a JSP page in each tab using jsp:include. You can hide/show the tabs using CSS/JS and/or a request parameter.

  • Maintaining session across multiple browser windows and page refreshes

    Hi there,
    We're currently developing a Flex application with a couple of session-related requirements that we're not sure how to solve. Before we jump in and maybe go about things in the wrong way, I thought I'd post and see if anyone here knows of some elegant solutions!
    Currently, when our Flex app starts the user is presented with a log-in screen which authenticates the user against our server. Client-server communication is done through BlazeDS.
    Our first requirement is the ability to open a new browser window from Actionscript - this window will load a pdf document. The servlet that serves this pdf should deny the request if the user is not already logged in. The only way we can see to do this so far is to open the pdf url using navigateToUrl() with the '_blank' target, passing a jsessionid token as a url parameter. Is there a better way to preserve session state when opening a new window?
    The second requirement is to preserve some application and session across browser refreshes. Our Flex app has several screens that the user can tab between. If the user hits F5 or the refresh button in their browser, we'd like the app to return to the same screen after the refresh. I've been looking into using BrowserManager to add a fragment such as #screen=2 to the url, but of course we only want the app to display screen 2 if the user has already authenticated with the server. Is there a way to reuse the user's existing session credentials after a page refresh?
    Many thanks in advance for any advice anyone can offer on this. It could very well be that we're missing something about how BlazeDS uses / exposes session credentials that would make all of this easier to implement than we currently realise!

    We use javascript to pass values between a 'data look up' window and the originating Servlet. If this is of any use, I can send you some examples.

  • Transaction across multiple databases in the same BDB environment

    Hi,
    I have multiple databases and one metadata database all in the same BDB environment. At runtime I want to create an additional database, update this database and update the metadata database in the same environment under one transaction. Are there any issues in having transactions that span multiple databases in the same environment?
    Thanks,
    Pooja

    There is virtually no difference between using multiple databases and a single database in a transaction. Concurrency is determined by other factors such as whether multiple threads access the same records. See the Writing Transactional Applications for more information:
    http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/index.html
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Maintaining sync across multiple audio tracks

    In the timeline I have a single video track  with some sync images and some B-roll images that float against the soundtracks. I have  8 audio tracks, some in sync with different video clips some not. I've trimmed one B-roll video clip and deleted a portion of it.
    How do I adjust the 8 different audio tracks so they don't lose their sync relationship with the video timeline as a whole?
    Used to be when cutting motion picture film multitracks we could delete an equal amount of fill from each track at different points for each so the overall sync stays the same.
    But slug doesn't seem the same as fill--you can't mark a portion of slug in the timeline and delete it.
    What I've figured out is to measure the timecode length of my deleted portion of a clip, and to advance each track along the timeline by that amount by selecting all audio tracks forward and entering the timecode. I guess if you inserted a B-roll clip you could do the reverse.
    This seems to work but there has got to be an easier way. Or isn't there?
    Doing these kinds of edits would seem to be standard for all kinds of docs and narratives but I can't find anything in the documentation except how to delete the same portions of tracks at the same edit points across all tracks.
    Thanks . . .
    Robert

    It's not clear to me exactly what you're trying say, but that's probably because didn't go to school for this... I'm pretty sure I know how to cut multiple audio and video tracks because I've been doing it since FCP3. No matter how you express it, the facts remain:
    You can cut with impunity if you go "old school" and unlink all the clips except the stereo pairs.
    You can create and cut slugs to fill spaces.
    You can mark clips to assist the sync process.
    What I usually do is find a good series of sync points and mark the clips, then de-link. From there I can fung shui the clips to my liking and add slugs to fill voids and prevent unintentional movement.
    Automatic? no. Difficult: no, not if you know your tools.
    ps: I also drive a manual shift car and navigate with a printed map...  it just works.

  • Problems with counter in renaming interface not maintaining consistency across multiple libraries

    Happy New Year, all.
    We have a problem in Aperture that I was curious if others had, and I'm hoping somebody has figured out a workaround they will share with me. Originally, we used Aperture and it had one huge library for our different types of photography. We had to change away from that setup because if there was a problem it would take ages to troubleshoot a ~500GB library and perform actions like rebuilding the library. We didn't want to do this, but splitting into six libraries has improved the speed in general and has made rebuilding smaller individual libraries quicker.
    We shoot a lot of photos and want each photo to have a unique number (along with a custom name). We set up a rename option in Aperture that has "Custom Name_Counter" and set counter to be six digits. The problem this seemed to create is that the counter in the rename function doesn't produce a unique number consistently across libraries. If I'm in library A, and I rename a batch of files, the counter will go up and remember its last number as long as I stay in Library A. The minute I switch to Library B, the number is at where it was the last time I used Library B. This indicates to me that the preferences travel with the library.
    Does anybody know a way that I can have a global preferences file, rather than a library preferences file? It seems it maybe used to be this way, but one of the version 3 upgrades forced me to delete a preferences file for the Facebook bug a couple of version 3 subversions ago.
    On a different note, another problem with renaming is that it is so slow. Renaming master files for even 100 or so files takes minutes. Does anybody else have this happen? Sometimes it's faster, but I haven't been able to figure out a pattern to this.
    I've submitted feature requests for revamping the renaming interface for Aperture for at least a couple of years. It never seems to improve. iView Media Pro, a program I used six years ago, had a great renaming setup and I wish Aperture
    Maybe it's time to reinstall Aperture. I bought it on disc, so it's not through the App store. Does anybody have experience reinstalling? I would, of course, like to keep keywords and other preferences.

    hallerphoto wrote:
    Machine is a Mac Pro dual quad-core 2.16 GHz.
    I am unaware of a 2.16 GHz Mac Pro tower. Are you referring to a Macbook Pro or to an iMac? Or is it a configuration I am just unaware of?
    My concern is that it seems that you may be making major workflow compromises that might be better dealt with by hardware changes as feasible. E.g. most 2.16 GHz Mac CPUs are about 1/6 as strong as a top Mac Pro today or about 1/4 as strong as today's Macbook Pros, and that has huge implications on Aperture performance.
    Also, graphics processors of the 2.16 GHz era were ridiculously weak compared to modern Macs. Aperture has historically performed best with strong GPUs (e.g. the strongest G5 towers would not run Aperture without a GPU upgrade). If you stay with the existing box a GPU upgrade may (if feasible) be in order.
    You did not mention RAM, which has defining impact on Aperture performance.
    Even if no hardware upgrades are made, it is useful to know what hardware performance bottlenecks may exist. So some questions:
    • Which Mac(s), exactly?
    • Which OS version and which Aperture version?
    • How much RAM is on board?
    • If a Mac Pro, which GPU card is in use?
    • What mass storage (hard drives and SSDs), how connected and how full?
    Thanks.
    -Allen

  • Maintaining session across multiple browsers

    Hello All,
    We have an application that runs using Apache Struts. One of the requirements is to pop-up a "data look up" window, i.e. a new browser window. The problem is, when I start this window any communication between this new window and server happens on a brand new session. I would like to maintain the same session as the parent window. Any ideas?

    We use javascript to pass values between a 'data look up' window and the originating Servlet. If this is of any use, I can send you some examples.

  • How to maintain more users in jsp page

    i need a multi user login. each user should have thier own username and password (supplied by me) then each user should have their own page

    k_paramesh wrote:
    i need a multi user login. each user should have thier own username and password (supplied by me) then each user should have their own pageThat's nice. Have you got a question?

Maybe you are looking for

  • Look for missing items across 2 tables

    Hi All Basically I have following 4 tables (including two lookup tables) My intention is Basically first needs to find out what are the matching records between ModTab and MedTab through link keys (ItemID & TrfCode through Lookup1) and then missing O

  • What's the best all in one printer on the market today for mac?

    All of the reviews by the media and users contradict each other leaving me very indecisive. I was thinking about the Epson Workforce 645 but one review said it wasn't compatible with Lion (and who knows if it will be compatible with Mountain Lion?).

  • Recursive methods.

    Can we create recursive methods in ABAP objects? Thanks in Advance !!! Please post your questions in the correct forum. Edited by: Rob Burbank on Oct 1, 2010 4:55 PM

  • Error insert

    SQL> INSERT INTO STORAGE VALUES (3980, 'DATA','/tmp') 2 / INSERT INTO STORAGE VALUES (3980, 'DATA','/tmp') ORA-01502: index 'SYS.INDEX_STORAGE' or partition of such index is in unusable state SQL>

  • When starting computer get message apple snyc notifier.exe-entry point not found

    when I start computer get message      "apple snyc notifier.exe-entry point not found"      what do i do to correct this