2

I am facing an issue on our production environment where we have 3 instances of Content Manager. I have developed an event handler which gets invoked on successful published transaction, in which I am trying to access the Publication’s Security tab properties to get the latest list of users associated with the publication.

But, I am not getting the latest/updated information present in the user group... so let’s say if I create a group with 5 users and restart all the Tridion services, I will get the exact details. However if I add another user in the group (without restarting the tridion services) and the event handler is executed, I only get 5 users instead of 6. Also, if I remove the group itself from Publication properties, the event system is still fetching the users.

The same functionality is working fine on our development environment where we have single instance of CM. I am wondering if there is some issue in our configuration related to caching/session or because of 3 instances of CM?

Any help would be appreciated.

Thanks

  • Can you please share the code snippet? – Hiren Kaku Dec 5 '16 at 18:11
1

If you are in a single CM environment, then all your events will always occur on that single environment. In a scale-out, where the events occur depends on the design of your scale-out. If you have a single CM dedicated to publishing, the SetPublishState event will occur on that server. If you have several publishers, then it will depend on which one processed the publish action. (Each publisher polls the CD environment for deployment feedback on the items it has published, and then updates the status in the CM.)

The consequences of this are:

  1. You need to have your events systems installed and configured on the relevant servers. (This might mean that you have different events systems on servers that fulfil different roles, although it's quite common to have a single assembly.)
  2. You won't necessarily get publishing related events on the servers that present the editorial interface.

I don't really understand the functionality you are trying to implement, or why you would wish to retrieve a list of users when a publish transaction completes. You should be aware that this is likely to impact the performance of your publisher.

You should also consider creating another environment that matches the scale-out design in production. Often Acceptance systems fulfil this role, although if you are creating functionality that will behave differently when scaled-out, it is prudent also to scale out your development system.

  • Thanks @Dominic, I am trying to retrieve the user list to send some notifications on successful publishing. However, to keep the publisher performance in mind, I am calling the method asynchronously after the transaction gets completed, EventSystem.SubscribeAsync<PublishTransaction, SetPublishStateEventArgs>(CallEvent, EventPhases.TransactionCommitted); To give you more insights we have used 1 assembly on all 3 servers and all of them are being used as Publisher. My only confusion is that why I am not getting the updated information which force me to think in direction of caching or session. – Yash Dec 6 '16 at 10:17
  • I agree it seems odd, I would expect the data to be consistent irrelevant of which server picks it up. Do you know if it gets correct "over time", i.e., if you change the data then try publishing 5-10 minutes later, do you get the right data? This would point at caching indeed. – Nuno Linhares Dec 6 '16 at 14:52
  • Caching would still presumably be per process/server... with the events system firing within a running process that could still have the data in cache. AFAIK there is no cache-invalidation mechanism that would inform a process hosting the CM of updates on another server. – Dominic Cronin Dec 6 '16 at 15:11
  • You might consider looking at the documentation for Tridion.ContentManager.Caching. If you can figure out which Region would be caching the relevant data, you could try calling .Flush() on it at the appropriate moment. Don't know about performance impact, but slow and correct can be better than fast and wrong. – Dominic Cronin Dec 6 '16 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.