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

Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting)

I'm playing around with the "CallContext" class to pass around extra
information between my client and Server applications (implemented with
Remoting).
My Server is a SAO-singlecall.

If I try to use the CallContext.GetData() method to retrieved information
from within a method in the Server part, all if fine.
If I try to do it from within the Constructor (which is called each time
prior a method is executed on the Server [singlecall]), the information is
not available ?????

I tried to look at the MSDN documentation about when such a information is
made available. However, I did not find anything...
Can anyone tell me the reason why the "CallContext" information is not
available when the Server Object Constructor is called?

Thanks a lot,
José

Nov 16 '05 #1
2 1548
Mon. Sep. 20, 2004 11:10 AM PT

I suppose your described scenario is exactly the same as I have in my
application. The reason is, that you are not able to get the CallContext in
the MBRO's ctor, because, this CallContext is available, only after the MBRO
is completely constructed, in other words, when its ctor execute comletely
only then in MBRO's method it is available.

You can see the behavior of SingleCall, ctor is not very important, as the
object is state-less, as soon it finishes its call it dispose it off. Hence,
I think CallContext is only available in MBRO's method call. It is not
clearly mentioned anywhere in MSDN, but if you read again the description
about the CallContext, and its examples, you will notice this fact.

Good Luck !!!

"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:uC**************@TK2MSFTNGP11.phx.gbl...
I'm playing around with the "CallContext" class to pass around extra
information between my client and Server applications (implemented with
Remoting).
My Server is a SAO-singlecall.

If I try to use the CallContext.GetData() method to retrieved information
from within a method in the Server part, all if fine.
If I try to do it from within the Constructor (which is called each time
prior a method is executed on the Server [singlecall]), the information is
not available ?????

I tried to look at the MSDN documentation about when such a information is
made available. However, I did not find anything...
Can anyone tell me the reason why the "CallContext" information is not
available when the Server Object Constructor is called?

Thanks a lot,
José

Nov 16 '05 #2
Thanks for your reply...

I guess I have to live with it... and in each method call a special utility
method to get the content of the callContext.
This is not what I was expecting...

José

"Lord2702" <Lo******@MSN.com> a écrit dans le message de
news:uj**************@TK2MSFTNGP11.phx.gbl...
Mon. Sep. 20, 2004 11:10 AM PT

I suppose your described scenario is exactly the same as I have in my
application. The reason is, that you are not able to get the CallContext in the MBRO's ctor, because, this CallContext is available, only after the MBRO is completely constructed, in other words, when its ctor execute comletely
only then in MBRO's method it is available.

You can see the behavior of SingleCall, ctor is not very important, as the
object is state-less, as soon it finishes its call it dispose it off. Hence, I think CallContext is only available in MBRO's method call. It is not
clearly mentioned anywhere in MSDN, but if you read again the description
about the CallContext, and its examples, you will notice this fact.

Good Luck !!!

"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:uC**************@TK2MSFTNGP11.phx.gbl...
I'm playing around with the "CallContext" class to pass around extra
information between my client and Server applications (implemented with
Remoting).
My Server is a SAO-singlecall.

If I try to use the CallContext.GetData() method to retrieved information from within a method in the Server part, all if fine.
If I try to do it from within the Constructor (which is called each time
prior a method is executed on the Server [singlecall]), the information is not available ?????

I tried to look at the MSDN documentation about when such a information is made available. However, I did not find anything...
Can anyone tell me the reason why the "CallContext" information is not
available when the Server Object Constructor is called?

Thanks a lot,
José


Nov 16 '05 #3

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

Similar topics

0
by: A Rothberg | last post by:
Have some questions about the behavior of CallContext and visibility to the CallContext data. Can someone please confirm (or deny) that the observed behaviors are by design and will not be...
0
by: José Joye | last post by:
I'm playing around with the "CallContext" class to pass around extra information between my client and Server applications (implemented with Remoting). My Server is a SAO-singlecall. If I try...
0
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows...
5
by: Pham Nguyen | last post by:
Hello, Is it appropriate to use the CallContext class for storing request-specific data? I have a set of business objects that I'm building. Each class contains a hashtable that maps from a key...
5
by: Adrian Parker | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the...
3
by: ExclusiveResorts | last post by:
Can the CallContext be used reliably for storing request specific data? We are developing an application library that uses the CallContext to keep an IdentityMap (hashtable of business objects...
11
by: nAmYzArC | last post by:
Hi all, On our site we have a section that allows users to copy and paste or drag and drop the contents of (pretty much any) webpage into a Div. I need to get access to the clipboard data. To do...
1
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...
6
by: =?Utf-8?B?TWF0dA==?= | last post by:
I'm having a problem with a static class constructor being called twice. I have the static class MasterTaskList which uses a BackgroundWorker to execute multiple methods on a separate thread. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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.