• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing data in session.  RSS feed

 
pramod mhatre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help to sort out this issue.
my application uses web services for getting results from suppliers.
General flow is search->reprice->booking
In this I want to insert all xml from search to book related to booking reference number in database after booking. So I can design GUI for checking all xml's from front end.
For every action from search to book are there so many xml's. While searching product I use near about 10 suppliers for getting result, so total xml's are more than 100. I need to keep it in session so that I can use proper xml to store in database after booking against booking reference number. My problem is some xml;s are having size 2 to 5 MB. So I think it will cause performance issue with system. Previously I used to store it in db but it also took lot of time to insert and application gets heavily hit it cause db connection exhaust. I need solution where I can maintain all xml in db against booking reference number. Also I can not leave other suppliers search xml after selecting particular product because user can go back and select another product.

Thanks In Advance.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML is not a good solution for storing data. XML is useful when you are communicating between applications. For storage of data, it adds a lot of overhead. It might be better for you to parse the XML and take the data out of it, and store the data in the database
 
pramod mhatre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jayesh but I am using data from xml for processing as per your suggestion.But our requirement is in case booking fails we need to check what was data xml provided by supplier. Our application use web service for getting data from some other servers of suppliers. Combine all results from all suppliers and show it to end user. Within this process sometimes data mishandling can be done. Sometimes we get proper supplier xml response but while digesting and showing it to front end it gets changed because of some misread while digesting. So we need to check what was the original xml.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would write the XML document to a temporary file, storing the name of the temporary file in the session.

Bill
 
pramod mhatre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill, but I tried it previously, for file read write it takes more time. If I am writing xml in file at the time of search it increase response time for showing search result at browser waiting to complete file writing thread.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pramod mhatre wrote:Thanks Bill, but I tried it previously, for file read write it takes more time. If I am writing xml in file at the time of search it increase response time for showing search result at browser waiting to complete file writing thread.


Actually, I doubt that.

If you try to parse the incoming stream to a DOM and then try to serialize it back to text in a file, sure that will be slow - lots of wasted object creation there.

If you just treat the request as a character stream and write it to disk it will be very fast.

Bill
 
pramod mhatre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill..
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!