PC Review


Reply
Thread Tools Rate Thread

Asynchronous Inserts

 
 
=?Utf-8?B?ZGJhMTIz?=
Guest
Posts: n/a
 
      26th Jul 2006

I need a way to do this insert below asynchronously and I'm pretty much lost
at this point.

Is there some example out there using Enterprise Library 2.0? We don't care
about the return, it's just a call to run a method in my class which performs
the insert and we need to give the call back to the client or something...I
guess this is asynchronous.
I am still a bit foggy on how asynchronous works (I guess you return the
call to the client and then on another thread it calls the method, not sure)
and there seems to be many approaches out there but nothing I found which
really shows me a good way to do it. I want the newest best way to do this
with a large public database with the most minimal effort. We get around 1.5
million hits a day. We're talking around maybe 100,000 inserts per minute
possibly. That's why we need to asynchronously call my method which performs
the insert. Maybe on another thread, maybe through ATLAS, who knows. I am new
to threading totally. Maybe threading isn't the best way, I am up in arms at
this point after searching for an hour on the net.

Is using ADO.NET commands the same as using commands in the Enterprise
Library Data class?

My boss told me in the beginning when I started to create a class to perform
the insert not to use ADO.NET but rather the Enterprise Library which was new
to me. I figured that out, very cool.

So the requirement here is to use the Enterprise Library classes to perform
the asynchronous insert. If there isn't a way to do that, I need help with
another way then.

Any advice, examples, direction here? I have seen using delegates, etc. but
really don't know if that's for us or how to determine if that's for
us...among other ways. I am also looking for other ways in which I have not
come across yet.

Our environment:

..NET 2.0
C# ASP.NET
VS 2005
Testing on our local PCs, we have no test server as of yet
VSS 2005

Here’s my insert statement:

public static void InsertSearchTerm(string SearchTerm)
{
DateTime CreateDate = DateTime.Now;
Int32 ResultCount = 1;

try
{
DatabaseFactory.CreateDatabase().ExecuteNonQuery("mystoredproc", SearchTerm,
ResultCount, CreateDate);
}
catch
{
throw;
}

}


--
dba123
 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      26th Jul 2006
You might look at the

http://msdn.microsoft.com/library/de...l/PAIBlock.asp

It was not pulled forward into the Enterprise Library.

But the build from 2003 is still stable.

This is truly as async method, as the process lives on a windows service
somewhere.

The application blocks lets you specify
ThreadCount
ProcessTimeMax
stuff like that.

and you have a db record if something didn't work. aka, it just doesn't
float out to never never land.

Run the client sample, but comment out all but 1 request. You'll then see
how it works. ("Bank1" i think it was).




"dba123" <(E-Mail Removed)> wrote in message
news:E8B36269-75E0-4A88-B49B-(E-Mail Removed)...
>
> I need a way to do this insert below asynchronously and I'm pretty much

lost
> at this point.
>
> Is there some example out there using Enterprise Library 2.0? We don't

care
> about the return, it's just a call to run a method in my class which

performs
> the insert and we need to give the call back to the client or

something...I
> guess this is asynchronous.
> I am still a bit foggy on how asynchronous works (I guess you return the
> call to the client and then on another thread it calls the method, not

sure)
> and there seems to be many approaches out there but nothing I found which
> really shows me a good way to do it. I want the newest best way to do this
> with a large public database with the most minimal effort. We get around

1.5
> million hits a day. We're talking around maybe 100,000 inserts per minute
> possibly. That's why we need to asynchronously call my method which

performs
> the insert. Maybe on another thread, maybe through ATLAS, who knows. I am

new
> to threading totally. Maybe threading isn't the best way, I am up in arms

at
> this point after searching for an hour on the net.
>
> Is using ADO.NET commands the same as using commands in the Enterprise
> Library Data class?
>
> My boss told me in the beginning when I started to create a class to

perform
> the insert not to use ADO.NET but rather the Enterprise Library which was

new
> to me. I figured that out, very cool.
>
> So the requirement here is to use the Enterprise Library classes to

perform
> the asynchronous insert. If there isn't a way to do that, I need help

with
> another way then.
>
> Any advice, examples, direction here? I have seen using delegates, etc.

but
> really don't know if that's for us or how to determine if that's for
> us...among other ways. I am also looking for other ways in which I have

not
> come across yet.
>
> Our environment:
>
> .NET 2.0
> C# ASP.NET
> VS 2005
> Testing on our local PCs, we have no test server as of yet
> VSS 2005
>
> Here's my insert statement:
>
> public static void InsertSearchTerm(string SearchTerm)
> {
> DateTime CreateDate = DateTime.Now;
> Int32 ResultCount = 1;
>
> try
> {
> DatabaseFactory.CreateDatabase().ExecuteNonQuery("mystoredproc",

SearchTerm,
> ResultCount, CreateDate);
> }
> catch
> {
> throw;
> }
>
> }
>
>
> --
> dba123



 
Reply With Quote
 
wfairl@gmail.com
Guest
Posts: n/a
 
      26th Jul 2006
Why do these inserts take so long? If you're doing some sort of
validation in the insert routine I would consider just dumping the raw
data in a "temporary" table and having a backend process (windows
service, database job, etc) poll, validate/clean, and insert the
records. The only other scalable and reliable solution would be to use
some sort of message queueing framework.


dba123 wrote:
> I need a way to do this insert below asynchronously and I'm pretty much lost
> at this point.
>
> Is there some example out there using Enterprise Library 2.0? We don't care
> about the return, it's just a call to run a method in my class which performs
> the insert and we need to give the call back to the client or something...I
> guess this is asynchronous.
> I am still a bit foggy on how asynchronous works (I guess you return the
> call to the client and then on another thread it calls the method, not sure)
> and there seems to be many approaches out there but nothing I found which
> really shows me a good way to do it. I want the newest best way to do this
> with a large public database with the most minimal effort. We get around 1.5
> million hits a day. We're talking around maybe 100,000 inserts per minute
> possibly. That's why we need to asynchronously call my method which performs
> the insert. Maybe on another thread, maybe through ATLAS, who knows. I am new
> to threading totally. Maybe threading isn't the best way, I am up in arms at
> this point after searching for an hour on the net.
>
> Is using ADO.NET commands the same as using commands in the Enterprise
> Library Data class?
>
> My boss told me in the beginning when I started to create a class to perform
> the insert not to use ADO.NET but rather the Enterprise Library which was new
> to me. I figured that out, very cool.
>
> So the requirement here is to use the Enterprise Library classes to perform
> the asynchronous insert. If there isn't a way to do that, I need help with
> another way then.
>
> Any advice, examples, direction here? I have seen using delegates, etc. but
> really don't know if that's for us or how to determine if that's for
> us...among other ways. I am also looking for other ways in which I have not
> come across yet.
>
> Our environment:
>
> .NET 2.0
> C# ASP.NET
> VS 2005
> Testing on our local PCs, we have no test server as of yet
> VSS 2005
>
> Here's my insert statement:
>
> public static void InsertSearchTerm(string SearchTerm)
> {
> DateTime CreateDate = DateTime.Now;
> Int32 ResultCount = 1;
>
> try
> {
> DatabaseFactory.CreateDatabase().ExecuteNonQuery("mystoredproc", SearchTerm,
> ResultCount, CreateDate);
> }
> catch
> {
> throw;
> }
>
> }
>
>
> --
> dba123


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
INSERTS Cheryl B Microsoft Word Document Management 1 30th Sep 2009 02:00 AM
Help on inserts =?Utf-8?B?ZmxhbWluZ2Zvcm11bGFz?= Microsoft Word Document Management 4 28th Apr 2006 03:30 PM
Inserts Jenny Microsoft Outlook Discussion 0 20th Jul 2004 05:53 PM
Re: dvd inserts Glen Millar Microsoft Powerpoint 1 6th Nov 2003 02:25 PM
multiple inserts jeff Microsoft Access Queries 2 22nd Aug 2003 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:38 PM.