473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Saving to data base

aaa
How can I save data without connecting to data base every time a client's
request
arrives?
If I work on a temporary memory I cannot work with sql queries, but connecting
to data base takes time.

Aug 24 '06 #1
3 1351
On Thu, 24 Aug 2006 04:31:01 -0700, aaa
<aa*@discussions.microsoft.comwrote:
>How can I save data without connecting to data base every time a client's
request
arrives?
If I work on a temporary memory I cannot work with sql queries, but connecting
to data base takes time.
If all you need to do is save the data and not query the database on
each request, just buffer the data in temporary memory and flush it
out to the database at intervals. I use a separate thread to access
the database and flush the accumulated data so as not to interfere
with ongoing data collection. That way, it doesn't really matter if
the database is occasionally a bit slow.


Aug 24 '06 #2
>How can I save data without connecting to data base every time a
>client's request arrives? If I work on a temporary memory I cannot
work with sql queries, but connecting to data base takes time.

If all you need to do is save the data and not query the database on
each request, just buffer the data in temporary memory and flush it
out to the database at intervals. I use a separate thread to access
the database and flush the accumulated data so as not to interfere
with ongoing data collection. That way, it doesn't really matter if
the database is occasionally a bit slow.
Just keep in mind, that in case of system crashes your data, which are
not written to the database, are not available anymore. So I think it's
depending on your use case, for most situations this is fine, but if you
go into some user login, accounting or similar, then it is crucial, that
the data the user submits really get written to the database, or if an
error occurs there, that the user is notified immediately of the error.

Markus
Aug 24 '06 #3
"aaa" <aa*@discussions.microsoft.comwrote in message
news:53**********************************@microsof t.com...
How can I save data without connecting to data base every time a client's
request
arrives?
If I work on a temporary memory I cannot work with sql queries, but
connecting
to data base takes time.
If you use the same connection string every time, then connection pooling
should take care of most of the delays caused by logging in. I assume you
are using SQL Server or SQL Server Express (the free version). Other
databases, like MySQL, may or may not offer this feature.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
Aug 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
0
by: zoneal | last post by:
I am trying to learn asp.net and have run into a wall with a problem. Can anyone help me through this problem? I am using the SqlDataSource (set to an Access data base). I have a grid view...
4
by: Annie | last post by:
Hi guys, I am having a weired situation that don't know how to handle it ... I have master pages, the master page contains a dynaic menu which is set up in the database and has page url, name,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.