473,395 Members | 1,595 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.

Concurrency problem using Unmanged code (COM+ dll)

Hi,

I am calling COM + dll from VB.net class.

When two clients invoke same method of com+ dll concurrently both
client requests fail.

COM + dll is insatlled in Library package.

I got same problem when when I changed packaege from Library to
server.

Any idea how to resolve this?

Any suggestions?

Thanks,

Sanjay
Jul 21 '05 #1
3 1668
There could be many reasons that could make your calls fail. More info.
needed. Better post a sample code to repeat the problem.

-jl

"Sanjay" <s_*****@hotmail.com> wrote in message
news:96**************************@posting.google.c om...
Hi,

I am calling COM + dll from VB.net class.

When two clients invoke same method of com+ dll concurrently both
client requests fail.

COM + dll is insatlled in Library package.

I got same problem when when I changed packaege from Library to
server.

Any idea how to resolve this?

Any suggestions?

Thanks,

Sanjay

Jul 21 '05 #2
Hi,

Here is sample dotnet code:

VB.net class

*****************
Imports BPLogFunction

Public Class LogWrapper

' Pointer to an external unmanaged resource.
Private handle As IntPtr

Public Sub New()
Me.handle = handle
End Sub

Public Function SearchUser(ByRef userId As String, ByVal objectType As
String) As Boolean
Dim _params(1, 1) As String
Dim _result As Boolean
Dim _bpCom As New BPLogFunction.CBPLogFunction

_params(0, 0) = "Function" : _params(0, 1) = "SEARCH"
_params(1, 0) = "UserID" : _params(1, 1) = userId
_result = _bpCom .UserInfoFunctions(CType(_params, System.Array))
' Call the appropriate methods to clean up
' unmanaged resources here.
' If disposing is false,
' only the following code is executed.
CloseHandle(handle)
handle = IntPtr.Zero
Return _result
End Function
*****************
Thanks, Sanjay

"jeff" <af****@hotmail.com> wrote in message
news:Ok*************@TK2MSFTNGP12.phx.gbl...
There could be many reasons that could make your calls fail. More info.
needed. Better post a sample code to repeat the problem.

-jl

"Sanjay" <s_*****@hotmail.com> wrote in message
news:96**************************@posting.google.c om...
Hi,

I am calling COM + dll from VB.net class.

When two clients invoke same method of com+ dll concurrently both
client requests fail.

COM + dll is insatlled in Library package.

I got same problem when when I changed packaege from Library to
server.

Any idea how to resolve this?

Any suggestions?

Thanks,

Sanjay


Jul 21 '05 #3
Can not see any problem here. What is Private handle for? What is it doing
inside UserInfoFunctions?
"Sanjay Patil" <S_*****@hotmail.com> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
Hi,

Here is sample dotnet code:

VB.net class

*****************
Imports BPLogFunction

Public Class LogWrapper

' Pointer to an external unmanaged resource.
Private handle As IntPtr

Public Sub New()
Me.handle = handle
End Sub

Public Function SearchUser(ByRef userId As String, ByVal objectType As
String) As Boolean
Dim _params(1, 1) As String
Dim _result As Boolean
Dim _bpCom As New BPLogFunction.CBPLogFunction

_params(0, 0) = "Function" : _params(0, 1) = "SEARCH"
_params(1, 0) = "UserID" : _params(1, 1) = userId
_result = _bpCom .UserInfoFunctions(CType(_params, System.Array))
' Call the appropriate methods to clean up
' unmanaged resources here.
' If disposing is false,
' only the following code is executed.
CloseHandle(handle)
handle = IntPtr.Zero
Return _result
End Function
*****************
Thanks, Sanjay

"jeff" <af****@hotmail.com> wrote in message
news:Ok*************@TK2MSFTNGP12.phx.gbl...
There could be many reasons that could make your calls fail. More info.
needed. Better post a sample code to repeat the problem.

-jl

"Sanjay" <s_*****@hotmail.com> wrote in message
news:96**************************@posting.google.c om...
Hi,

I am calling COM + dll from VB.net class.

When two clients invoke same method of com+ dll concurrently both
client requests fail.

COM + dll is insatlled in Library package.

I got same problem when when I changed packaege from Library to
server.

Any idea how to resolve this?

Any suggestions?

Thanks,

Sanjay



Jul 21 '05 #4

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

Similar topics

15
by: Mark Sisson | last post by:
Hey all. I've got a legacy COM dll that I'd like to use in my multithreaded C# app. Problem though is when I create several instances of the interop object and start them on their own threads...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
8
by: Ravneet | last post by:
I am trying to do some calls to unmanaged DLL that I have written. I am doing it in the Session_Start of my Global.asax.cs. The first time I call a function in my DLL it returns correct string...
3
by: Sanjay | last post by:
Hi, I am calling COM + dll from VB.net class. When two clients invoke same method of com+ dll concurrently both client requests fail. COM + dll is insatlled in Library package. I got...
2
by: brian_harris | last post by:
I have a 3rd party unmanged .dll. This has functions that will look up information and fill a C string passed to it with data. I want to use this data in .NET classes after it has been filled and...
5
by: Vayse | last post by:
In my save code, most of items save fine. But sometimes I get a concurrency violation message. "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." It happens on the...
3
by: Petded | last post by:
I have seen some articles on using unmanged dll's in managed c++, but they all see to require knwing the paramters and structures of the the dll functions to be called. I have this freeware dll...
1
by: ropo | last post by:
I am using .NET 2.0 I have a C#.Net App, which uses a .NET Class Library, which accesses a COM object through interop. The C#.Net App also uses a mixed mode C++.Net Class library which uses an...
1
by: sonic1981 | last post by:
Hi Everyone I'm trying to access an unmanged dll from ASP.Net (C#). I'm basically calling a logon method within the dll but when I get to this method call the system hangs? I've checked all the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.