Print Page | Close Window

Can we determine the client that started a save?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1424
Printed Date: 22-Sep-2025 at 4:22am


Topic: Can we determine the client that started a save?
Posted By: Sinnema
Subject: Can we determine the client that started a save?
Date Posted: 14-Aug-2009 at 12:10am
Hi,
 
We need to find a unique Identifier for the Client from which the SaveChanges originated. In the OnSaving and OnSaved methods on the Server we do see a SessionKey, but that is not the UserToken we use in the PushNotification. How can we determine from which Client the Save originated?
 
We would like to send this Identifier allong to all Clients. That way the Client from which the SaveChanges originated, knows it does not have to do anything when it receives the Push Notification from the server with it's own Id in the message. All other Clients will refetch the changed Entities (and handle concurrency) on receiving the Push Notification.
 
Regards,
Paul Sinnema
Diartis AG
 



Replies:
Posted By: kimj
Date Posted: 14-Aug-2009 at 7:09am
The Principal of the user doing the save is available to the OnSaving and OnSaved event handlers (you can also always obtain it from the thread for the duration of the request on the server).  The Principal is also always available on the client, either from EntityManager.Principal or the thread.  It might be the best way of uniquely identifying each client, or maybe useful in a mapping of Principals to UserTokens.  



Print Page | Close Window