New Posts New Posts RSS Feed: Using the push Notification freeze the queries
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Using the push Notification freeze the queries

 Post Reply Post Reply
Author
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Topic: Using the push Notification freeze the queries
    Posted: 05-Sep-2012 at 11:06am
Hi,

I am stuck in the Push notification since some times and I can't find what is wrong in my project.

Here is my problem :
I created a push service on the server. As soon as I register to this service, all my queries in the application takes forverer.
Let's say I create a Company in a ViewModel and a 2nd Viewmodel query the cache to load this same entity (on the exact same model as Cocktail). This should be very fast but no, it can takes more than 1 minute (when it doesn't timout ...) !

If I don't register to the service, the application works just fine.

I tried to look what's going on in fiddler and the entityService.svc/sl waits for the response all the time.




About the configuration I added the notificationService key to the web.config and added the SL5 server polling dll to the server.
On the client I added the SL5 polling dll and the push dll of devforce.

I did try to reproduce it on Temphire but it works just fine. I have the same configuration, same assemblies (I even converted temphire to SL5 to check if the problem was with SL5).

Nothing looks wrong in the logs, I compared the Temphire's logs with mine and they have the same stuff about the notification.

I am using Devforce 6.1.8 with cocktail.

What could cause this delay ? What should I look for ?



if that matter, here is my test push service (and it works, I get the notification on the client) :

        [AllowRpc]
        public static void NewDossiersAdministratifs(Guid serviceKey, INotificationManager notificationManager, EntityManager entityManager)
        {
            _serviceKey = serviceKey;
            _notificationManager = notificationManager;
            _manager = new AdministratifEntities(entityManager);
 
            while (true)
            {
                Check();
                // Sleep de 30 seconds entre les checks
                Thread.Sleep(1000 * 30);
            }
        }
 
        private static void Check()
        {
            var subscribers = _notificationManager.GetSubscribers(_serviceKey); 
            if (!subscribers.Any()) return;
 
            var ids = new List<int>() {1, 2};
            foreach (var subscriber in subscribers)
            {
                _notificationManager.Send(_serviceKey, subscriber, ids);
            }
        }





Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 06-Sep-2012 at 4:54am
Hi,


I found out the problem thanks to this post "Polling duplex services slows down other services" : http://forums.silverlight.net/t/24007.aspx/1/10

I appears the file Global.asax.cs is the problem. In Temphire this file doesn't exist all the code is inside the Global.asax file

<script language="C#" runat="server">
 
    /// <summary>
    /// Perform application start activities.  
    /// </summary>
    protected void Application_Start(Object sender, EventArgs e) {
 
      // To enable remote viewing of trace messages via the TraceViewer:
      // TODO:  Comment/uncomment the following line as appropriate for your installation
      //IdeaBlade.Core.TracePublisher.LocalInstance.MakeRemotable();     
      
      // Register a virtual path provider for *.svc files.  
      // You do not need to supply .svc files for the EntityService and EntityServer services
      // when the provider is registered.      
      System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());     
    }			
</script>
If you move this code in the file Global.asax.cs the polling will makes the devforce's services lags.

I updated Temphire to use a polling service with a Global.asax.cs file.
Everytime you change you selection in the search module, you will notice every loading takes 10-15s.
Change back to the original Global.asax and it's less than 1s

Hope it can helps those who will have the same issue ! 






Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down