• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session or DB

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a requirement wherein I am taking the user input in 7 steps. Each step is a JSP.
I am wondering what is the best approach with respect to saving the data.

a) Should I save the data in session as the user moves from step1 to step7 and then save it in the database. This approach will put huge data in the session. Though the user base of this application is only 5-6 users.

b) Save it everytime in the database as the user moves from step1 to step7. The problem with this approach is what if user decides not to complete all the steps and leave after step4 then I will have to rollback the data for Step1 to Step4.

Secondly, currently we have given Next button on each JSP page to move to next Step. Can this also be implemented in tabs wherein each tab will be a seperate JSP page?

I am using Struts framework to develop the application.

Please advise.
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Better to put data in session,
because after you given data in 4 steps as you said you can rollback how would be do that?
Is that 7 steps having 7 different DB tables?
If that is so we need so have column in that tables which is reffering to main table PK of user.
On that basis we can delete that data after 4th step. but that not sounds good.

So I thing better to hold data in session till 7 step.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic