jason teh wrote:
> 
> Hi there!
> 
> I was wondering if anybody would be able to help with
> using NDC? Is the NDC class used to keep track of
> multiple users when using log4j? If so, how would I
> use it? I can't seem to find any good code egs. Does
> anybody know of any?
> 
Hi Jason,

In general, no.  NDC is not the answer to keeping
track of mulitple users.  NDC is great for keeping
track of mulitple threads.  In an application server
it is often the case that each user request gets its
own thread.  But the next request will result in a 
different thread being assigned.  Moreover, the
thread from the first request often does not get
destroyed, but rather reused.  So if you do not
clear NDC info before finishing (or before starting),
a later request will have NDC info from a previous
request.

This makes NDC better suited for tracking a particular
request within a multithread app server serving many
requests concurrently.  I worked on an insurance claim
registration system where the claim-id was used in the
NDC to track it separately from other claims being
registered at the same time.  Since the claim-id was
unique to a particular request, the NDC info could be
cleared out before the next request.

- Paul
-- 
Beware of bugs in the above code.  I have
only proved it correct, not tried it.
-Don Knuth

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • NDC jason teh
    • Paul Glezen

Reply via email to