473,805 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET (thread safe? ) Page / DTS Package execution.

I have a DTS package that can be execute from ASP.net and I was
wondering if there is a way to make this thread safe some how. I know
thread safe isn't exactly the word I'm looking for but let me know
what the correct term is. What I have is an asp.net page that executes
a DTS package and I want to be sure no two people will click a submit
button on this page from 2 different computers at the same time. And if
they do I want one to be locked until the other person's request is
done processing or at least notify the user to try again. I would
prefer to find a way to notify the person and do this in ASP.net
because I have some other pages that need to be done this way with
plain SQL update queries that aren't DTS;(I do use transactions and
locking) but I was wondering if I can just find out of another person
is on the same page, or if its processing that page from another
instance of Iexplorer. If this isn't possible, a way to prevent this
in the DTS package would work almost as well. Any ideas are
appreciated, Thanks!

Nov 19 '05 #1
4 1822
Dwight:

You can wrap the code inside of a Monitor.TryEnte r and a Monitor.Exit. Specify
a timeout value for TryEnter and if the method returns a false - someone
else still has the lock and you can notify the user. A Monitor will only
permit one thread to execute the code it is guarding.

--
Scott
http://www.OdeToCode.com/blogs/scott/
I have a DTS package that can be execute from ASP.net and I was
wondering if there is a way to make this thread safe some how. I know
thread safe isn't exactly the word I'm looking for but let me know
what the correct term is. What I have is an asp.net page that executes
a DTS package and I want to be sure no two people will click a submit
button on this page from 2 different computers at the same time. And
if
they do I want one to be locked until the other person's request is
done processing or at least notify the user to try again. I would
prefer to find a way to notify the person and do this in ASP.net
because I have some other pages that need to be done this way with
plain SQL update queries that aren't DTS;(I do use transactions and
locking) but I was wondering if I can just find out of another person
is on the same page, or if its processing that page from another
instance of Iexplorer. If this isn't possible, a way to prevent this
in the DTS package would work almost as well. Any ideas are
appreciated, Thanks!

Nov 19 '05 #2
I thought of that, i didnt try it because i didnt think it would work
that way in ASP.net. Im not too famaliar with the inner workings but i
just assumed that wouldnt apply in asp.net like it does in windows
forms. I will still try it. Its difficult to reproduce the problem I
am having. Ill keep you updated.

Nov 19 '05 #3
I was just thinking. Would the monitor still work on a dual processor
cpu ? Im not totaly sure how far up the monitor goes, but possibly to
the appdomain? Im not sure, but im wondering if each processor gets an
appdomain. Im also wondering if i should or could use the application
object to store a boolean weather its locked. I might be going
overboard but for some reason I keep having a doubt that the monitor is
safe. i thought about using a static class to help but im not sure when
it would get destroyed. (im not just asking scott, but whomever)
Thanks!
-Dwight

Nov 19 '05 #4
Monitors do work on MP machines - if they didn't we'd all be in big
trouble :).

Monitors do not work across appdomains. In general you won't have to
worry about that unless you have webgardens enabled on a 2003 server.
A static isn't necessarily the whole solution, as you'd still need to
synchronize access to the static member.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 26 Jan 2005 23:01:14 -0800, "dwight0" <dw*******@yaho o.com> wrote:
I was just thinking. Would the monitor still work on a dual processor
cpu ? Im not totaly sure how far up the monitor goes, but possibly to
the appdomain? Im not sure, but im wondering if each processor gets an
appdomain. Im also wondering if i should or could use the application
object to store a boolean weather its locked. I might be going
overboard but for some reason I keep having a doubt that the monitor is
safe. i thought about using a static class to help but im not sure when
it would get destroyed. (im not just asking scott, but whomever)
Thanks!
-Dwight


Nov 19 '05 #5

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

Similar topics

0
1009
by: Roman Suzi | last post by:
Hi! Just to be sure, is email package of Python 2.3 thread-safe or not (to use, for example, in python-milter?) Sincerely yours, Roman A.Souzi
5
1876
by: Roman Suzi | last post by:
(this is a repost with an addition - probably noone noticed my message first time) Hi! Just to be sure, is email package of Python 2.3 thread-safe or not (to use, for example, in python-milter?) P.S. And where can I find information on particular piece of standard library if it is thread-safe or need locking? I recall 'random' module is (was?)
9
5624
by: Andy Chang | last post by:
Hi, If I have this function void DoSomething(int& index) { ::Sleep(10000); DoSomethingWith(index); } Is the variable index thread safe? Meaning that if I call this from two
20
3501
by: Sacha | last post by:
Consider I have a working thread like this, while (1) { if ( g_pObject ) g_pObject->DoOneStep(); } with an class hierarchie like this
5
2394
by: Dan Tallent | last post by:
I am trying to learn how to create an application that uses worker threads to prevent the UI from freezing up. My question is: Is the following code considered "thread safe"? If not, what am I doing wrong? Thanks Dan -------------------------------------------------------- I have a form with this code:
1
4540
by: Tommaso Caldarola | last post by:
If I call System.Runtime.Remoting.CallContext.SetData() and then I call System.Runtime.Remoting.CallContext.GetData() from a different thread I get null, if the thread indeed is the same I get right data. How to do CallContext.GetData() thread safe? Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
1
4248
by: philwozza | last post by:
Hi I have a THREAD class that uses the static variable NextThreadID to store the id of the next thread to be created and a static Mutex to protect it. class THREAD { public: int Start(void); private: unsigned int ThreadID;
44
7870
by: climber.cui | last post by:
Hi all, Does anyone have experience on the thread-safty issue with malloc()? Some people said this function provided in stdlib.h is not thread- safe, but someone said it is thread safe. Is it possible this function evolves from thread-unsafe to thread-safe in recent years? How could i find out? I am using the C library coming with GNU linux distribution. thanks a lot.
0
921
by: Steve Holden | last post by:
Allen Taylor wrote: You can publish it in the Python package index - see http://pypi.python.org/pypi/ If you want to have it considered for inclusion into future versions of Python then you should post a bug to bugs.python.org wiht your patch as an attachment and the test of the above mail as a rationale for the change. Thanks for going to these lengths to contribute!
0
9718
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, 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...
0
9596
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,...
0
10614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10369
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,...
0
9186
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, 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...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
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...

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.