Hi
Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET -
Data Access) Thread safe?
The documentation has no references to threads.
Thanks
Dan 6 2148
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.co m
"Dan" <da*********@ho tmail.com> wrote in message
news:cc******** *************** ***@posting.goo gle.com... Hi
Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET - Data Access) Thread safe?
The documentation has no references to threads.
Thanks
Dan
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.c om> wrote in
message news:OI******** ******@tk2msftn gp13.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.co m
"Dan" <da*********@ho tmail.com> wrote in message news:cc******** *************** ***@posting.goo gle.com... Hi
Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET - Data Access) Thread safe?
The documentation has no references to threads.
Thanks
Dan
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****@idonotl ikespam.cce.umn .edu> wrote in message
news:eo******** ******@TK2MSFTN GP11.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.c om> wrote
in message news:OI******** ******@tk2msftn gp13.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.co m
"Dan" <da*********@ho tmail.com> wrote in message news:cc******** *************** ***@posting.goo gle.com... Hi
Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET - Data Access) Thread safe?
The documentation has no references to threads.
Thanks
Dan
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******** ******@TK2MSFTN GP09.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****@idonotl ikespam.cce.umn .edu> wrote in message news:eo******** ******@TK2MSFTN GP11.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.c om> wrote in message news:OI******** ******@tk2msftn gp13.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.co m
"Dan" <da*********@ho tmail.com> wrote in message news:cc******** *************** ***@posting.goo gle.com... > Hi > > Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET - > Data Access) Thread safe? > > The documentation has no references to threads. > > Thanks > > Dan
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****@idonotl ikespam.cce.umn .edu> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Got it. Could you briefly describe a senario when that might occur?
Thanks again.
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******** ******@TK2MSFTN GP11.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****@idonotl ikespam.cce.umn .edu> wrote in message news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Got it. Could you briefly describe a senario when that might occur? Thanks again.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 static void UpdateDataset(SqlCommand insertCommand, SqlCommand
deleteCommand, SqlCommand updateCommand, DataSet dataSet, string tableName)
{
if( insertCommand == null ) throw new ArgumentNullException(
|
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. But I was unable to
find any instructions on referencing the neccessary DLLs in any of the
Help files or walkthroughs. Did I miss it somewhere?
Which DLLs do I reference? The walkthroughs seem to tell me how to use
SqlHelper and such, but I cant...
|
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'.
But when i am trying to run the sample, i am getting the following error in the Event Viwer.
Kindly help me on this.
|
by: Jim Hubbard |
last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
|
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 client (MS Access vs
..NET Windows Forms) would be preferred over the other. While I have some
good arguments on both sides, I would appreciate your points of view on the
topic.
| |
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 properly on the localhost server
but my online server does not have the ms Ent lib installed and also
de\oes not have visual studio that simply a .net 1.1 installed on that.
|
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.
::::::::::
Source Error:
|
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?
|
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 Microsoft.ApplicationBlocks.Data.dll
is 2.0
The call to SqlConnection.Open() fails after I upgrade to .Net 3.0
The application runs under a tweaked version of Medium trust. After the
upgrade and the call to .Open() fails if I change the trust to Full the...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |