PC Review


Reply
Thread Tools Rate Thread

The Database Application Block

 
 
Simon Harvey
Guest
Posts: n/a
 
      10th Sep 2004
Hi all,

Can someone please reasure me that it is entirely possible to use the Data
Access Application in large applications - even those that require
transactions?

I have a friend who is adament that the application block is crap because it
uses static methods. He thinks that because its using static methods it is
completely riddled with concurrency holes.

He also believes that it will cock up transactions because it shares a
connection object or something.

I on the other hand am next to certain that the static methods are thread
safe and that transactions are handled correctly shared connection or not.

Can someone please reasure me and my paranoid friend :-) that the *Best
Practice* application block from Micorsoft are actually safe to use in
large, concurrent, transaction based situations without needing vast
amendments.

Many thanks to anyone who can advise.

Take care

Simon


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      10th Sep 2004
Hi,

it only has static state for parameters (etc DAAB has capability to cache
parameters for procs).

If you look at its code, you'll note it doesn't have a public constructor or
instance methods (cannot be instantiated, cannot have instance state) so
everything happens in a method calls and is released after call ends. E.g
means that multiple threads can call the methods very safely and the calls
won't mix up with each other (everything needed is given as parameter to the
method as is per the idea of static methods)

What comes to the transactions, you need to pass the SqlTransaction object
to DAAB method calls and then the state is kept it that transaction object
(basically)/connection associated with the transaction, not in DAAB.
Therefore transactions work just fine as well, though you'd of course try to
put them as much as possible into database procs themselves and not into
ADO.NET client code, if not necessary. But either way, no problems.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> Can someone please reasure me that it is entirely possible to use the Data
> Access Application in large applications - even those that require
> transactions?
>
> I have a friend who is adament that the application block is crap because

it
> uses static methods. He thinks that because its using static methods it is
> completely riddled with concurrency holes.
>
> He also believes that it will cock up transactions because it shares a
> connection object or something.
>
> I on the other hand am next to certain that the static methods are thread
> safe and that transactions are handled correctly shared connection or not.
>
> Can someone please reasure me and my paranoid friend :-) that the *Best
> Practice* application block from Micorsoft are actually safe to use in
> large, concurrent, transaction based situations without needing vast
> amendments.
>
> Many thanks to anyone who can advise.
>
> Take care
>
> Simon
>
>



 
Reply With Quote
 
Nick Malik
Guest
Posts: n/a
 
      11th Sep 2004
As Teemu pointed out, there is no problem using the DAAB with large
transacted systems.

Just to add to that: one of the I'm familiar with uses this AB. The number
of transactions is fairly high (10,000 per hour), and the amount of data
being managed is somewhere around 100GB. We've had other load problems, but
not one that is traced to the DAAB.

Really, the DAAB is a convenience... I'm not sure I'd call it a "best
practice" DAL. It's nice, but you will still have to have a smart developer
doing smart things to use it well.

Hope this helps,
--- Nick

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> Can someone please reasure me that it is entirely possible to use the Data
> Access Application in large applications - even those that require
> transactions?
>
> I have a friend who is adament that the application block is crap because

it
> uses static methods. He thinks that because its using static methods it is
> completely riddled with concurrency holes.
>
> He also believes that it will cock up transactions because it shares a
> connection object or something.
>
> I on the other hand am next to certain that the static methods are thread
> safe and that transactions are handled correctly shared connection or not.
>
> Can someone please reasure me and my paranoid friend :-) that the *Best
> Practice* application block from Micorsoft are actually safe to use in
> large, concurrent, transaction based situations without needing vast
> amendments.
>
> Many thanks to anyone who can advise.
>
> Take care
>
> Simon
>
>



 
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
Re: Logging Application Block to Jet Database? miher Microsoft Dot NET Framework 0 2nd Sep 2009 09:28 AM
Include the application data with the tracer msg in Logging Application block Samy Microsoft ASP .NET 0 9th Nov 2005 08:03 PM
Problem with enterprise application block - data block Showjumper Microsoft ASP .NET 1 19th Mar 2005 03:48 PM
The Database Application Block Simon Harvey Microsoft ADO .NET 2 11th Sep 2004 07:29 PM
The Database Application Block Simon Harvey Microsoft Dot NET Framework 2 11th Sep 2004 07:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:32 AM.