Shared transients and notifications

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Shared transients and notifications

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:41 pm

by JensRichnow >> Thu, 5 Dec 2002 23:00:01 GMT

I thought it is worthwhile to post this topic as I spend about 4 hours to get it right.

In my case the shared transients subscribe to notifications in the ::create() method. In the ::delete() of the shared transient I have the ::endNotificationForSubscriber(self). The shared transients, however, are deleted in a different process then the creating process. This results in a number of 1227 exceptions, depending on the number of transients deleted. Now the NotificationException::notificationTarget() was a bit misleading as it pointed to different class/object.

Basically, the notification has to be ended in the same process that creates the shared transient. In my case the creating process is identical with the monitoring process, so I knew when a shared transient is about to be deleted and can end the notifications for this instance at a specific point.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Shared transients and notifications

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:41 pm

by cdshearer >> Fri, 6 Dec 2002 3:50:19 GMT

Notifications can be tricky when dealing with SharedTransients! The point that isn't really mentioned in the help is that when you begin a notification, you're beginning it for a particular *process*. If that process goes away, the notification no longer exists!

I have used a technique whereby there is a separate background application responsible for subscribing, and receiving notifications for SharedTransient objects.

Craig


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 16 guests