473,396 Members | 2,014 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,396 software developers and data experts.

Microsoft Application Blocks for .NET - Data Access

Dan
Hi

Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
Data Access) Thread safe?

The documentation has no references to threads.

Thanks

Dan
Nov 15 '05 #1
6 2130
Dan,

I would say probably not. For most of the classes in the framework (and
those classes outside of it, but still written by microsoft, like the Data
Block), the instances are not guaranteed to be thread safe (but the static
methods usually are).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan" <da*********@hotmail.com> wrote in message
news:cc**************************@posting.google.c om...
Hi

Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
Data Access) Thread safe?

The documentation has no references to threads.

Thanks

Dan

Nov 15 '05 #2
What exactly does it mean for a class to be thread safe? My guess would be
something along the lines of whether you can create two instances of the
same class in two different threads. But why exactly would this ever be a
problem??

Thanks!

mark

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OI**************@tk2msftngp13.phx.gbl...
Dan,

I would say probably not. For most of the classes in the framework (and those classes outside of it, but still written by microsoft, like the Data
Block), the instances are not guaranteed to be thread safe (but the static
methods usually are).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan" <da*********@hotmail.com> wrote in message
news:cc**************************@posting.google.c om...
Hi

Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
Data Access) Thread safe?

The documentation has no references to threads.

Thanks

Dan


Nov 15 '05 #3
Hi Mark,

Thread safe means that you can invoke any method or read/write any
field/property from whatever thread and don't be concerned about integrity
of data (IOW it don't make kaboooom when two threads access the same data
).

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
What exactly does it mean for a class to be thread safe? My guess would be something along the lines of whether you can create two instances of the
same class in two different threads. But why exactly would this ever be a
problem??

Thanks!

mark

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:OI**************@tk2msftngp13.phx.gbl...
Dan,

I would say probably not. For most of the classes in the framework

(and
those classes outside of it, but still written by microsoft, like the Data Block), the instances are not guaranteed to be thread safe (but the static methods usually are).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan" <da*********@hotmail.com> wrote in message
news:cc**************************@posting.google.c om...
Hi

Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
Data Access) Thread safe?

The documentation has no references to threads.

Thanks

Dan



Nov 15 '05 #4
Got it. Could you briefly describe a senario when that might occur? Thanks
again.

Mark
"Miha Markic" <miha at rthand com> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
Hi Mark,

Thread safe means that you can invoke any method or read/write any
field/property from whatever thread and don't be concerned about integrity
of data (IOW it don't make kaboooom when two threads access the same data
).

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
What exactly does it mean for a class to be thread safe? My guess would

be
something along the lines of whether you can create two instances of the
same class in two different threads. But why exactly would this ever be a
problem??

Thanks!

mark

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote

in
message news:OI**************@tk2msftngp13.phx.gbl...
Dan,

I would say probably not. For most of the classes in the
framework (and
those classes outside of it, but still written by microsoft, like the

Data Block), the instances are not guaranteed to be thread safe (but the static methods usually are).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan" <da*********@hotmail.com> wrote in message
news:cc**************************@posting.google.c om...
> Hi
>
> Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
> Data Access) Thread safe?
>
> The documentation has no references to threads.
>
> Thanks
>
> Dan



Nov 15 '05 #5
Hi Mark,

Imagine that a not thread-safe class having a string public property.
Imagine one thread that tries to set new value (setting string is done in
several procesor operations - thus is not atomic).
Imagine thread context switching to another thread (while string setting is
not ended - left at the middle) that starts reading the same property.
Boooom.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Got it. Could you briefly describe a senario when that might occur? Thanks again.

Nov 15 '05 #6
This only applies if both threads have a reference to the same object, or
the property is static.

Willy.

"Miha Markic" <miha at rthand com> wrote in message
news:Oo**************@TK2MSFTNGP11.phx.gbl...
Hi Mark,

Imagine that a not thread-safe class having a string public property.
Imagine one thread that tries to set new value (setting string is done in
several procesor operations - thus is not atomic).
Imagine thread context switching to another thread (while string setting is not ended - left at the middle) that starts reading the same property.
Boooom.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Got it. Could you briefly describe a senario when that might occur?

Thanks
again.


Nov 15 '05 #7

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

Similar topics

2
by: BStorm | last post by:
I ran into a maddening bug that I finally tracked down to Microsoft's Data Access Blocks. It is in the SQL Helper UpdateDataSet method as follows: Microsoft Code: #region UpdateDataset public...
7
by: scott289 | last post by:
I have successfully downloaded the Enterprise Library and the data access block (C#). I am able to compile and run the quickstart application. So I would like to try the DAB in a new project....
3
by: Karuppasamy | last post by:
Hi I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net . I installed everything as per the Instructions given in the 'Development Using the Logging Block'. ...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
4
by: Mukesh | last post by:
Hi I m using microsoft application blocks Enterprise Library june 2005 with .net framework 1.1 and VStudio2003 And C# as coding language Sql server 2000 database the project is running...
3
by: Mukesh | last post by:
Thx Sloan for the solution. It is working properly under Full trust When i tried it under Medium trust it was giving error Parser Error Message: Required permissions cannot be acquired....
3
by: Justin Kadima | last post by:
I'm considering porting one of my application in order to use the Microsoft enterprise library and I am contemplating the pros and cons of doing it. Are you guys using the library?
5
by: Michael Howes | last post by:
I'm upgrading a VS 2003/.Net 1.1 ASP.Net application to VS 2008/.Net 3.0 The application uses an older version of the Microsoft Data Blocks for database access. The version in the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.