473,395 Members | 1,726 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,395 software developers and data experts.

Server-Clients, Threads, Reflection, Processes and Everything Else

11
Hi All

I've got a real puzzler that I just can't seem to get my head around. Basically I'm writing a server-client using a third party dll to access their database. The third party library requires a login using a static method before any of the other methods can be used:

tpdll.Login(Username, Password); *

* The username and password will always be the same in my app

When a client connects to my server app it fires a new thread and calls this login. If there is only 1 client connecting at a time its fine. If one client connects and then a second client connects while the first is still logged into the third party dll the first client is disconnected from using the dll.

I've tried 2 completely seperate applications that log into the third party dll using the same logins and run them parallel and they worked fine so I know the third party app allows the same user to be logged in twice. So is this a problem with the threads using the same login at the same time? If so is there anyway to load the dlls seperately for each thread?

I'm using c# .net 2.0
Nov 20 '08 #1
3 1135
balabaster
797 Expert 512MB
Sounds like a bug in their dll... have you tried contacting them? It seems to me that if it's a static method then it should be written such that it is threadsafe. Does the method return a value?
Nov 20 '08 #2
Plater
7,872 Expert 4TB
I would say what is happening is you have created what is really a single instance of the object, that is being shared over the webapplication (application only loads the dll once after all)
And you are trying to use it as if it were being loaded each time?

Try pretending like every user on the web application is the same and coding for that way (you might have to put in some lock(){} calls to prevent race conditions) and see if that stops one person being shut out by the other?
Nov 20 '08 #3
Frinavale
9,735 Expert Mod 8TB
I would say what is happening is you have created what is really a single instance of the object, that is being shared over the webapplication (application only loads the dll once after all)
And you are trying to use it as if it were being loaded each time?

Try pretending like every user on the web application is the same and coding for that way (you might have to put in some lock(){} calls to prevent race conditions) and see if that stops one person being shut out by the other?

I think Plater's on to something here.

I did that once.

I was half following a tutorial when creating a DLL that handles database interactions.... the tutorial declared a shared database connection and I wasn't paying attention to the "Shared" keyword...

When I used it in a multi-threaded application and tried I ran into some pretty crazy problems with the DLL. Much like you are describing here.

-Frinny
Nov 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
10
by: sara | last post by:
Hi All, I was able to connect to MS SQL Server 2005 on my computer but after a while I can not. When I want to connect to it using MS SQL Server Management Studio I got this error: An error...
1
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: ...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.