Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 2nd, 2004, 08:55 AM
ak ak is offline
Authorized User
 
Join Date: Sep 2003
Location: London, , United Kingdom.
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default efficiency qn xml vs sql server - to record counts

Hi,

originally posted in asp xml area ...but noticed it was v slow to resceve response:-)

need some advise on the best approach to take and also if any one knows of a any resouce on this subject that exists online?

When a banner displays on my site, the banner display count is recorded in an xml file and the xml file is saved each time

follwing error occures occasionally:
msxml3.dll error '80070020'
The process cannot access the file because it is being used by another process.
/globalincludes/incBanner.inc, line 291


my questions:
[1] is it better to use a sql server database then xml for recording such data? e.g banner display count could amount to as much as 10000 in a day.

[2] This continuous and frequent saving of the xml file due to client activity - am i using xml for an inappropriate purpose? I had initially done this to reduce the hits on our sql server.

looking forward any valuable replies.


ak
__________________
ak
Reply With Quote
  #2 (permalink)  
Old March 2nd, 2004, 09:18 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

Hi there,

For 10,000 writes a day, I would go for the database solution. A database is designed for a multi-user scenario, while, as you found out, writing to an XML file may get you into concurrency problems.

Another approach is to cache the data in in-memory variables, and write them every 10 or 100 hits. This approach would only work if the exact count isn't very important. That is, missing a few counts shouldn't be a problem in that scenario. If, for instance, the server reboots, you loose the number of hits currently held in memory.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old March 3rd, 2004, 12:03 PM
ak ak is offline
Authorized User
 
Join Date: Sep 2003
Location: London, , United Kingdom.
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar Spaanjaars
Thanks for your help. I have taken your advice to look into the alternatives and decided to use application variables, hope this causes no problems.

Regards
ak

ak
Reply With Quote
  #4 (permalink)  
Old March 3rd, 2004, 05:26 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

Hi there,

Well, it *can* cause problems when your server or IIS restarts (something that happens more frequent than you'd expect).

Check out this article for more information and for a database solution to save your variables: http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=165

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server 2005 XML: FOR XML PATH -> cdata? stoves SQL Server 2005 1 July 8th, 2008 03:40 AM
Multiple doc'ts w/ specific record elements counts kapy_kal XSLT 2 March 29th, 2006 11:25 AM
How to unlock record in SQL Server database DDB001 SQL Server 2000 2 August 2nd, 2004 10:46 AM
efficiency qn - writing and saving xml file ak Classic ASP XML 1 March 2nd, 2004 05:26 PM
efficiency qn:ado .AddNew VS INSERT in stored proc ak Classic ASP Databases 1 February 25th, 2004 10:08 AM



All times are GMT -4. The time now is 10:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.