Tridion 2013 SP1 Core service timeout with frequent requests











up vote
3
down vote

favorite












We have a problem whereby after making a certain (larger) number of requests to the Core Service, the requests begin to time out with the following message:




The request channel timed out while waiting for a reply after
00:01:00. Increase the timeout value on the Binding. The time allotted
to this operation may have been a portion of a longer timeout.




The failure is on:




Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService.Read(String
id, ReadOptions readOptions)




When initializing the core service client we do this:



ISessionAwareCoreService coreServiceClient = factory.CreateChannel(); 


I suspect, given other posts, that the problem is that the coreServiceClient is not disposed of once we've finished with it, and thus we get to a point where we are unable to create any further connections.



Other posts on a similar topic: /WebUI/Models/TCM54/Services/General.svc/GetUserSettings taking TEN minutes to respond



Is there a way to dispose of the coreServiceClient when we are finished with it, and does this seem like a plausible cause of the issue?










share|improve this question




























    up vote
    3
    down vote

    favorite












    We have a problem whereby after making a certain (larger) number of requests to the Core Service, the requests begin to time out with the following message:




    The request channel timed out while waiting for a reply after
    00:01:00. Increase the timeout value on the Binding. The time allotted
    to this operation may have been a portion of a longer timeout.




    The failure is on:




    Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService.Read(String
    id, ReadOptions readOptions)




    When initializing the core service client we do this:



    ISessionAwareCoreService coreServiceClient = factory.CreateChannel(); 


    I suspect, given other posts, that the problem is that the coreServiceClient is not disposed of once we've finished with it, and thus we get to a point where we are unable to create any further connections.



    Other posts on a similar topic: /WebUI/Models/TCM54/Services/General.svc/GetUserSettings taking TEN minutes to respond



    Is there a way to dispose of the coreServiceClient when we are finished with it, and does this seem like a plausible cause of the issue?










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      We have a problem whereby after making a certain (larger) number of requests to the Core Service, the requests begin to time out with the following message:




      The request channel timed out while waiting for a reply after
      00:01:00. Increase the timeout value on the Binding. The time allotted
      to this operation may have been a portion of a longer timeout.




      The failure is on:




      Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService.Read(String
      id, ReadOptions readOptions)




      When initializing the core service client we do this:



      ISessionAwareCoreService coreServiceClient = factory.CreateChannel(); 


      I suspect, given other posts, that the problem is that the coreServiceClient is not disposed of once we've finished with it, and thus we get to a point where we are unable to create any further connections.



      Other posts on a similar topic: /WebUI/Models/TCM54/Services/General.svc/GetUserSettings taking TEN minutes to respond



      Is there a way to dispose of the coreServiceClient when we are finished with it, and does this seem like a plausible cause of the issue?










      share|improve this question















      We have a problem whereby after making a certain (larger) number of requests to the Core Service, the requests begin to time out with the following message:




      The request channel timed out while waiting for a reply after
      00:01:00. Increase the timeout value on the Binding. The time allotted
      to this operation may have been a portion of a longer timeout.




      The failure is on:




      Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService.Read(String
      id, ReadOptions readOptions)




      When initializing the core service client we do this:



      ISessionAwareCoreService coreServiceClient = factory.CreateChannel(); 


      I suspect, given other posts, that the problem is that the coreServiceClient is not disposed of once we've finished with it, and thus we get to a point where we are unable to create any further connections.



      Other posts on a similar topic: /WebUI/Models/TCM54/Services/General.svc/GetUserSettings taking TEN minutes to respond



      Is there a way to dispose of the coreServiceClient when we are finished with it, and does this seem like a plausible cause of the issue?







      2013-sp1 core-service






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 6 hours ago









      Atila Sos

      2,5441720




      2,5441720










      asked 6 hours ago









      Harald Greve

      500214




      500214






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          You should definitely dispose of the client once you're done with it. Increasing timeouts is always an option but most of the time it's just masking an issue and not confronting the root cause.



          To dispose the client:



          In 2013 you can do:



          if (_client.State == CommunicationState.Faulted)
          {
          _client.Abort();
          }
          else
          {
          _client.Close();
          }


          For Web 8 and later, you can do the following:



          _client.Dispose();


          Or simply use a using block which will call dispose for you.



          See here




          UPDATE



          Based on the comment.



          You can switch your implementation to the SessionAwareCoreServiceClient class (the rest of the code remains the same). To instantiate it, you can use the following code fragment (with the appropriate constructor (for example with the EndPointConfigurationName)):



          SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient();





          share|improve this answer























          • The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
            – Harald Greve
            6 hours ago










          • Updated my answer
            – Atila Sos
            4 hours ago


















          up vote
          0
          down vote













          Besides everything Atila said in his answer, i would like to state that you can use ChannelFactory class also to instantiate web client and use it like in the snippet bellow:



          using (ChannelFactory<ISessionAwareCoreService> chanelFactory = new ChannelFactory<ISessionAwareCoreService>(endpoint))
          {
          chanelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(coreServiceUser, coreServicePass);
          ISessionAwareCoreService client = chanelFactory.CreateChannel();
          //use client here
          }


          Please make note that it is also instantiating client within using blocks, so its auto disposed.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "485"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftridion.stackexchange.com%2fquestions%2f19581%2ftridion-2013-sp1-core-service-timeout-with-frequent-requests%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            You should definitely dispose of the client once you're done with it. Increasing timeouts is always an option but most of the time it's just masking an issue and not confronting the root cause.



            To dispose the client:



            In 2013 you can do:



            if (_client.State == CommunicationState.Faulted)
            {
            _client.Abort();
            }
            else
            {
            _client.Close();
            }


            For Web 8 and later, you can do the following:



            _client.Dispose();


            Or simply use a using block which will call dispose for you.



            See here




            UPDATE



            Based on the comment.



            You can switch your implementation to the SessionAwareCoreServiceClient class (the rest of the code remains the same). To instantiate it, you can use the following code fragment (with the appropriate constructor (for example with the EndPointConfigurationName)):



            SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient();





            share|improve this answer























            • The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
              – Harald Greve
              6 hours ago










            • Updated my answer
              – Atila Sos
              4 hours ago















            up vote
            3
            down vote













            You should definitely dispose of the client once you're done with it. Increasing timeouts is always an option but most of the time it's just masking an issue and not confronting the root cause.



            To dispose the client:



            In 2013 you can do:



            if (_client.State == CommunicationState.Faulted)
            {
            _client.Abort();
            }
            else
            {
            _client.Close();
            }


            For Web 8 and later, you can do the following:



            _client.Dispose();


            Or simply use a using block which will call dispose for you.



            See here




            UPDATE



            Based on the comment.



            You can switch your implementation to the SessionAwareCoreServiceClient class (the rest of the code remains the same). To instantiate it, you can use the following code fragment (with the appropriate constructor (for example with the EndPointConfigurationName)):



            SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient();





            share|improve this answer























            • The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
              – Harald Greve
              6 hours ago










            • Updated my answer
              – Atila Sos
              4 hours ago













            up vote
            3
            down vote










            up vote
            3
            down vote









            You should definitely dispose of the client once you're done with it. Increasing timeouts is always an option but most of the time it's just masking an issue and not confronting the root cause.



            To dispose the client:



            In 2013 you can do:



            if (_client.State == CommunicationState.Faulted)
            {
            _client.Abort();
            }
            else
            {
            _client.Close();
            }


            For Web 8 and later, you can do the following:



            _client.Dispose();


            Or simply use a using block which will call dispose for you.



            See here




            UPDATE



            Based on the comment.



            You can switch your implementation to the SessionAwareCoreServiceClient class (the rest of the code remains the same). To instantiate it, you can use the following code fragment (with the appropriate constructor (for example with the EndPointConfigurationName)):



            SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient();





            share|improve this answer














            You should definitely dispose of the client once you're done with it. Increasing timeouts is always an option but most of the time it's just masking an issue and not confronting the root cause.



            To dispose the client:



            In 2013 you can do:



            if (_client.State == CommunicationState.Faulted)
            {
            _client.Abort();
            }
            else
            {
            _client.Close();
            }


            For Web 8 and later, you can do the following:



            _client.Dispose();


            Or simply use a using block which will call dispose for you.



            See here




            UPDATE



            Based on the comment.



            You can switch your implementation to the SessionAwareCoreServiceClient class (the rest of the code remains the same). To instantiate it, you can use the following code fragment (with the appropriate constructor (for example with the EndPointConfigurationName)):



            SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient();






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 4 hours ago

























            answered 6 hours ago









            Atila Sos

            2,5441720




            2,5441720












            • The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
              – Harald Greve
              6 hours ago










            • Updated my answer
              – Atila Sos
              4 hours ago


















            • The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
              – Harald Greve
              6 hours ago










            • Updated my answer
              – Atila Sos
              4 hours ago
















            The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
            – Harald Greve
            6 hours ago




            The problem I have is that the ISessionAwareCoreService type used is not implicitly convertible to System.IDisposable. I don't have any of those aforementioned commands available on my ISessionAwareCoreService instance.
            – Harald Greve
            6 hours ago












            Updated my answer
            – Atila Sos
            4 hours ago




            Updated my answer
            – Atila Sos
            4 hours ago










            up vote
            0
            down vote













            Besides everything Atila said in his answer, i would like to state that you can use ChannelFactory class also to instantiate web client and use it like in the snippet bellow:



            using (ChannelFactory<ISessionAwareCoreService> chanelFactory = new ChannelFactory<ISessionAwareCoreService>(endpoint))
            {
            chanelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(coreServiceUser, coreServicePass);
            ISessionAwareCoreService client = chanelFactory.CreateChannel();
            //use client here
            }


            Please make note that it is also instantiating client within using blocks, so its auto disposed.






            share|improve this answer

























              up vote
              0
              down vote













              Besides everything Atila said in his answer, i would like to state that you can use ChannelFactory class also to instantiate web client and use it like in the snippet bellow:



              using (ChannelFactory<ISessionAwareCoreService> chanelFactory = new ChannelFactory<ISessionAwareCoreService>(endpoint))
              {
              chanelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(coreServiceUser, coreServicePass);
              ISessionAwareCoreService client = chanelFactory.CreateChannel();
              //use client here
              }


              Please make note that it is also instantiating client within using blocks, so its auto disposed.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Besides everything Atila said in his answer, i would like to state that you can use ChannelFactory class also to instantiate web client and use it like in the snippet bellow:



                using (ChannelFactory<ISessionAwareCoreService> chanelFactory = new ChannelFactory<ISessionAwareCoreService>(endpoint))
                {
                chanelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(coreServiceUser, coreServicePass);
                ISessionAwareCoreService client = chanelFactory.CreateChannel();
                //use client here
                }


                Please make note that it is also instantiating client within using blocks, so its auto disposed.






                share|improve this answer












                Besides everything Atila said in his answer, i would like to state that you can use ChannelFactory class also to instantiate web client and use it like in the snippet bellow:



                using (ChannelFactory<ISessionAwareCoreService> chanelFactory = new ChannelFactory<ISessionAwareCoreService>(endpoint))
                {
                chanelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(coreServiceUser, coreServicePass);
                ISessionAwareCoreService client = chanelFactory.CreateChannel();
                //use client here
                }


                Please make note that it is also instantiating client within using blocks, so its auto disposed.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 3 hours ago









                Marko Milic

                4,38121144




                4,38121144






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Tridion Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftridion.stackexchange.com%2fquestions%2f19581%2ftridion-2013-sp1-core-service-timeout-with-frequent-requests%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                     ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕