VimClient.FindViewEntities returns null after a period of time

Hi all

I'm hosting a c# webservice in IIS that makes calls against our instance of vsphere to carry out certain functions.  A basic call is to get a list of all virtual machines.  Every so often, the webservice will get in a State in which the call returns a null value (we always have lots of virtual machines to the top):

List<EntityViewBase> views = c.FindEntityViews(typeof(VirtualMachine), null, null, null);
if (views== null) throw new Exception("List of VMs from VimClient.FindEntityViews is null!");

At this point, I believe that this occurs if the Web service has not been restarted or recycled in some time.  Most likely, I'm storing the VimClient incorrectly.

I'm caching of connection of VimClient in the following way.  My reason for doing this is so save time on calls (it takes about 20 seconds to call VimClient.Connect () to each webservice call, if I don't do this).

(1) for Web service starts, I give the floor

private static VimClient _vsphereClientConnection = null;
_vsphereClientConnection = new VimClient();
ServiceContent sc = _vsphereClientConnection.Connect(vsphereServerURL);
UserSession us = _vsphereClientConnection.Login(vsphereUsername, vspherePassword);

(2) I can enter this instance of the VimClient every time I need to perform a function at the instance of vSphere

public static VimClient VSphereClientConnection
{
 get 
{
 Initialize.waitForInitialization(0);
 return _vsphereClientConnection; 
}
}

where Initialize.waitForInitialization () checks if VimClient has completed the connection to vSphere.

I cache this connection wrong?  Is there a better way to do this / a how to do it at all?  Or maybe I make a wrong assumption about why FindEntityViews returns null.

I thought I could detect in the VSphereClientConnection property if the connection has expired in any way and re - connect, but it's not ideal because then the user must wait until the initialization again.  I'm also not sure how to check if the service is in bad shape without making a call that I know does not work in these States 'bad '.

Thank you

Jason

You can call SessionManager.sessionIsActive () to validate a session.  You could also do some other data requests.  Firewall between you and vCenter can sometimes drop idle connections (vCenter has a vpxd.httpClientIdleTimeout configuration value to increase or decrease and it should be higher that your firewall connection inactive drops).

You can also simply cache the session ID (which is essentially in the cookie).  I don't know if the c# Toolbox has hooks to do this easily, however.  Perl, and it works very well in web servers.  The logic is get sessionID, attempting to load the existing session, in case of failure, try the new name of connection with the stored credentials.

Tags: VMware

Similar Questions

  • After a period of time, my computer hangs

    I am running Vista Home Premium service pack 1. I have 4 GB of ram. After a period of time, whether it's idle or am working on it, it freezes. all I have to do is open Task Manager and then close and everything works again. y at - it a setting I need to change?

    Hello

    Yes, you must install SP2 as soon as possible.

    How to troubleshoot Windows Vista and Windows Server 2008 service pack
    installation issues.
    http://support.Microsoft.com/kb/947366

    Service Pack Center
    http://Windows.Microsoft.com/en-us/Windows/downloads/service-packs

    I hope this helps.

  • password change after a period of time.

    As an administrator, I want to set up user accounts to ensure that the password would be changed after a period of time. How, or what is possible.

    Hello

    You can only do this with Vista Business & Ultimate Versions.

    As administrator, please do the following.

    Orb - click with the right button on computer - manage - local Users and Groups - users - open the user name

    -Uncheck the boxes for the user cannot change password and password never expires.

    In search bar type gpedit.msc hit enter key.

    Computer Configuration - settings - security settings - account policies - password policy

    Now you can change the settings according to your needs.

    Please keep in mind that my answer is based on the information in your message. More the better I can answer, Slan go foill, Paul

  • Screen: For several days my laptop screen not turn off after a period of time, of no use. I have to put it in mode 'sleep' me or there is 'on '.

    For several days my laptop screen turn off after a period of time, of no use.  I have to put it in mode 'sleep' me or there is 'on '.  What happened to cause this?

    http://www.Vistax64.com/tutorials/198047-power-plan-restore-default-settings.html

    Try to reset the default power Plan settings. information is at the link above.

    http://www.Vistax64.com/tutorials/63567-power-options-sleep-mode-problems.HTML?filter [11] = power % 20Management

    And how to solve problems in Standby Mode is at the link above.

    And read the information of 'Related links', too.

    See you soon.

    Mick Murphy - Microsoft partner

  • HTML5 Canvas move one image after a period of time

    I'm new to JavaScript and html5 Canvas and you want to move one image after a period of time, for example, after an audio clip is finished playing.

    I tried: setTimeout (function () {this.getStage () .getChildAt (0) .gotoAndPlay (2);}, 36000);

    This code does not work.

    The equivalent AS3 is: function wait() {stop (); var myInterval = setInterval (function () {play (); clearInterval (myInterval);}, 36000) ;} / / end of the function wait();}

    Thank you.

    Is to understand "extended", who looks much more like the ActionScript 2.0. The word 'this' as you have it does not refer to what you think it does. Because it is inside a function (anonymous function for setInterval you did), it comes to this scope.

    Two ways to resolve this problem, assign the current scope and use inside the anonymous function or use the shortcut of exportRoot.

    affect the scope

    This.Stop ();

    var _scope =;

    {setTimeout (function ()}

    _scope.getStage () .getChildAt (0) .gotoAndPlay (2); using the reference _scope retained by the top

    (}, 36000);

    Or this shortcut in the root scope:

    {setTimeout (function ()}

    exportRoot.gotoAndPlay (2);

    (}, 36000);

  • PersistentObject.getContents () returns null after app update

    Hello

    I'm trying to track down a bug with PersistentStore.
    Usually when I update the app I get the getContents() stored content.
    However, something in the code has changed from one version to the other and now getContents() returns null.

    I made sure the id has never changed for PersistentStore.getPersistentObject (id);
    I made sure that we use the same basic sdk (4.3.0)
    I made sure that there are the data stored in the stored hash table

    Currently, it's a hash table - no subclass (even though I know that I should change it to a subclass when it's fixed);

    I wonder if there are any suggestions on what might cause the getContents() return null - or which could result in the PersistentStore have cleared.

    What information is needed, please let me know and I'll paste.

    I found the problem after.

    Classes have begun to obscure differently. If the hash table was still readable, but because he could not read the content of the hash table, he would return null.

    It was unexpected, because if you have a custom class persisted and you try to read it, you will get the content, but you can't cast. But with the hash table, it does not return the content (uncastable) and it throws no exceptions...

    I hope this helps someone else who has a similar problem.

  • % ROWCOUNT SQL return null after Forms_DDL on a dynamic SQL

    Hello

    I'm new to PL/SQL coding and is currently working on the development of some application in Oracle Forms as a result of the 10 g developer.

    I'm having a problem getting a number of lines (number of rows affected by the last command dml) to register after using forms_ddl
    PROCEDURE P_SQL_UPDATE IS
    
      L_string1                VARCHAR2(250);
      L_string2                VARCHAR2(250);
      L_string3                VARCHAR2(250);
      L_string4                VARCHAR2(250);
      L_rowcount                Pls_integer;
      L_count                  NUMBER;
      L_alert                       NUMBER;
    
    BEGIN
    
      L_string1 := 'UPDATE ' || :global.G_table_nam || ' SET ';
      L_string2 := NULL;
      L_string3 := ' WHERE ';
      L_string4 := NULL;
    
    ...
    ... building strings 2 and 3
    ...
    
    :global.final_sql := L_string1 || L_string2 || L_string3 || L_string4;
    
      FORMS_DDL(:global.final_sql);
      L_rowcount := SQL%ROWCOUNT;
    
      if FORM_SUCCESS then
        set_alert_property('ALT_COMMIT_ROLLBACK',ALERT_MESSAGE_TEXT, 'The # of rows affected: ' || L_rowcount || CHR(10) || 'Commit or Rollback?');
        L_alert := show_alert('ALT_COMMIT_ROLLBACK');
        if L_alert = ALERT_BUTTON1 then
          commit;
        else
             rollback;
        end if;
      else
        set_alert_property('ALT_INFO',ALERT_MESSAGE_TEXT, 'Error: ' || DBMS_ERROR_CODE  || ' - ' ||DBMS_ERROR_TEXT);
        L_alert := show_alert('ALT_INFO');
      end if;
       
    END;
    I tried to replace the global variable with a string 1 potential SQL hard coded, I changed L_rowcount to digital, attempted to directly display rowcount % SQL via dbms_output.put_line... L_rowcount is just empty during the pop-up alert.

    Another solution has been L_rowcount: = DBMS_SQL. LAST_ROW_COUNT; ... This gives a slightly different result in the alert window, instead of being white, it returns 0. If something is definitely not right. Another is that in doing so, he always returned null/one field blank on the alert popup.

    I have run tests on SQL % number of lines in the editor of TOAD and got results, but during the actual shape that l_rowcount is always null after the execution of the procedure (with the exception of being 0 using the dbms_sql.last_row_count).


    I want to emphasize that change is not introduced without the additional validation in the FORM_SUCCESS at the end... I had read that the Forms_DDL is an implicit validation and committing the SQL without anything else happening... This seemed a little odd as well.

    Before forms_ddl, I tried to use execute, exec, or run immediately on the SQL, but nothing helped. I think of one other option would be to pass this SQL to a datablock again together and use to execute query on this block? Don't know how to go about it.



    The purpose of this form is intended for users to enter values in a generic form and when he meets the validation in the field triggers, they will support on submit and ideally before the update is committed I want users to be notified of the # of lines that would be affected by their proposed... change so if the # is huge they will know that they did something wrong before they affect the entire database.


    Any input would be appreciated,
    Travis

    Travis,
    The built-in function Forms_DDL() emits an implicit VALIDATION because the transaction is issued as DDL no DML. Therefore, given that the VALIDATION is the last command issued by the call of Forms_DDL, the attributes of the cursor of the implicit cursor (SQL) will all be set to NULL. If you absolutely must have the number of LINES of the documents concerned, you can create a database program unit that you can spend your dynamic statement too and have it return zero (failure) or the number of affected records (success).

    In addition, since Forms_DDL() emits an implicit VALIDATION, you must create a BACKUP point before calling Forms_DDL() If you want the ability to RESTORE any changes made in the call to Forms_DDL().

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere July 26, 2011 09:29

  • My computer started to disconnect automatically after a period of time.

    My computer just start automatically disconnect after no activity during a short period of time.  How can I prevent the it disconnects.   I am running Windows 7.

    Hello

    Open windows control panel, open personalization, click on the link on the bottom right and in the next window, screen saver set time "Wait" to a more acceptable figure and Remove the tick in the box next to "in curriculum vitae, the logon screen.  Click on apply, then Ok to save the setting.

    Kind regards

    DP - K

  • desktop PC: after certain period of time reduced the brightness of the screen - cannot turn off

    Win 7 64 bit

    AMD hd 6870 connected via HDMI pn59d500 samsung plasma tv

    What is going on:

    If I am reading an article or by typing in a comment like this box, the screen turns off after a certain period of time.

    -mouse mobile, typing, scrolling window or motion/movement of the window (like firefox) on the desktop does not work for normal brightness screen.

    -resizing of the window will be brighten screen (also by clicking on the Start button or start another application or similar activities).

    What I've done and additional info:

    -My hdtv eco settings and and autobrightness are all off. I don't have the problem with other components related to this view. This is not the problem of the screen

    -my desktop pc power settings are not set to reduce brightness at any time. I even disabled the «turn off the display after...» "option. Anyway, same problem. I have the computer put to sleep after 20 minutes.

    -a ran the troubleshooting of windows power - I know how to click and read. There is nothing outside of the obvious and already known.

    As-i crossed all the parameters of the CCC (the suite software amd vid card). the only color/quality setting I use is deinterlacing with drop-down auto-detection. pixel format is set to RGB 4:4:4 limited. I have active treatment of ITC (will try not disabled, no idea what it affects). I use manual detection of displays... no setting under "desktop management", "my digital flat screens", and "video" seems to do anythign with dimming screen.

    I read through the first 5 pages of the "Sun Office" search results here... no related response.

    just thought to google the registry entries related to power... but always options this issue. I'll look into registry changes after.

    Hello

    Please update us on the issue. Office is different from the laptop, and because the screen is dimming as it does in a laptop, it is related to the power settings or the driver itself. These are the only two things that are responsible for the same in a laptop as well.

    Therefore, I recommend you try to create a new power plan or change the existing one to check. You can also refer to:

    http://Windows.Microsoft.com/en-us/Windows7/change-create-or-delete-a-power-plan-scheme

    Let us know the results when you try these methods.

    Thank you

  • Automatically remove virtual machines for VDI pool after the period of time

    Use us Vmware View 5.0 but soon move to 5.2 and have need features to automatically remove all the virtual machines in the pool selected after a certain period of time. We are at disposal VDI for a project that will end for 3 months and after this time, we want to remove this VMs automatically. Is this possible?

    It depends a bit exactly what you want to do, but you can plan everything a powercli-script to remove the virtual desktop at a certain time.

    Another option that I usually prefer is to manage the rights with the ad groups.

    So when you want to revoke a users access to a desktop computer, simply remove the user from the group, which should be easy to do with a script.

    Linjo

  • orgVdcNetwork.configuration.ipScope return null after upgrade to 5.1

    I'm currently testing my workflow because I upgraded my environment at 5.1.  It seems that orgVdcNetwork.configuration.ipScope now returns a null value for all of my orgVdcNetwork.  I was recovering information gateway and dns for use in my workflow of the ipScope.  I can't understand where that information went.  I tried it tears of the ExternalNetwork as well, and it's also coming back as null there.  I've rechecked in vCD and everything seems seems correct through the web administration tools.

    Paul

    Hello Paul,

    orgVdcNetwork and Exnternal networks are containing a list of ipScopes in vCD 5.1. In vCD to 1.5 was only a single ipScope.

    In order to get the ipScopes of orgVdcNetwork as a table, you can do:

    var ipScopes = orgVdcNetwork.configuration.ipScopes.ipScope.enumerate ();

    Enumerate() funtion replaces list table. If you have a single ipScope in the list, you can use it as
    ipScopes [0];
    Same thing can be applied to external networks.
    I hope this helps!
  • I have 6 Lightroom now but if I update to creative cloud and after a period of time you want to return to Lightroom 6 I'll be able to use the develop module in my Lightroom 6?

    Is the develop module of Lightroom 6 still available to me if I return from CC to the product I own?

    Yes but it can be a little tricky.

    LR 6 so the CC 2015 version are exactly the same. The difference is how you connect.

    Sign In with an Adobe ID a is or has been associated with the subscription and it becomes the CC 2015 version.

    Sign In with an Adobe ID that has never been associated with the subscription type and it becomes version 6. So since you have already used an e-mail address to activate the stand alone version 6 you must use a different email address, another ID Adobe buying the CC version. So if you ever want to revert to the version 6 You Sign Out with the Adobe ID email address, which IS associated with the subscription and back panel with the e-mail her IS NOT associated with the subscription.

  • Sound stops working after a period of time on my Satellite L755D - 14 M

    Hey there, I have a problem that I can't solve any how I try. Sometimes, when I play, I have sound, but all the all of a sudden it stops working, but I see no error. When I try to open a sound track through Windows Media Player, it says "year error occurred while trying to open this file through Media Player", or simillar.

    When I go on youtube, there is no sound, and there is no sound in games I play. And when I connect to Teamspeak to talk to my friends, I get an error saying that it is not able to connect to the audio device.

    I tried to update the sound card on the latest driver from Toshiba Web site through, but that did not resolve the error. The only solution I have now is to restart the computer to wait for the next time it will happen. Which I find really annoying.

    Is there than anything the people of this forum can help me with?

    Hello

    > When I try to open a sound track through Windows Media Player, it says "year error occurred while trying to open this file through Media Player", or simillar.

    I found an interesting article from the Microsoft Knowledge base where this error message is shown:
    http://support.Microsoft.com/kb/831430

    try to change the registry perhaps that helps

    If this does not work, I recommend using HARD drive recovery to reset the system.
    Since I m thinking its system damaged, HARD drive recovery should solve this problem.

  • Cable network keeps disconnecting after a period of time

    Hello

    I just bought a new Lenovo Z510 and I have serious problems with the network Ethernet cable. When I turn on the laptop and plug in the cable, it works for about 5 minutes. Then it suddenly disconnects (with software) while physically he is still connected. When I restart the computer, it works again for 5 minutes that follow. It's really annoying.

    1. I have not installed new software to date.
    2. it is not the problem of the cable (works fine on other laptops).
    3. Windows 8.1 diagnosis only says that the cable is diaconnected.
    4. I tried to reinstall the driver so I have the latest version of the web page from lenovo.
    5. There is not BIOS problem because it works fine first - then disconnects.

    I have really no idea of what it can cause. Does anyone have a similar experience? I suspect that maybe some Powermanagement kills service or something? But have no idea how to solve. Thanks for any advice.

    Ondrej

    Hi thanks for the reply. I tried everything above. Without success.

    Then I googled many repairs possible and, finally, the problem ceased when I
    uninstalled McAfee security. I have no idea what caused the problem but now
    It works perfectly.

    If the solution of the problem of Ethernet connection: uninstall McAfee!

    I have no idea why Lenovo should deliver so many third-party with software
    their products. And even if it causes problems. I have no idea if its only
    me, but I really suggest it first uninstall all the ballast that comes with
    the laptop. Its only 30 same day trial. Not good in it. Money for
    Lenovo ads. And a lot of nerves to its customers!

    Best regards and I hope this helps someone.

  • Desktop Windows 7 goes black after a period of inactivity and the user accesses their machine again

    Hello

    Wonder if anyone can offer help for an unusual problem?

    Users have Windows 7 machines that all have a background theme to display... Blue with a company Logo.

    User's for lunch and leave their posts after a period of time and/or powersaver screensaver comes in... all normal at this stage.

    After an hour, they return to their machine and they move the mouse/tap a key and bring the machine back (excuse my terminology :)) and the office went from the default theme for a black desktop computer... Icons/Applications behave very well.

    The temporary workaround is:

    1. open a session and on windows to restore the office back to normal.

    or...

    2. I do a restart of the "Desktop window Manager Session Manager" service that puts the office back to normal as well.

    Has anyone seen cela and worked a way how to make a permanent fix... have struggled on Google because the answers I find are around the screen savers that ISN'T the problem.

    See you soon,.

    Steve

    Hi Steve,.

    Thank you for the update. However, since these computers are connected to the domain, your question is beyond the scope of what is generally answered in this forum of consumer and would be better suited for the IT Pro TechNet public.

    Please post your question in the TechNet Forums.

Maybe you are looking for

  • macOS Sierra always invites credentials for network drives

    At home, we have several Macs, when connecting, to mount a network SMB readers of different servers (OS X Server and Synology NAS). The credentials (username and password) for the network drives are stored in the keychain of the user through the time

  • Satellite 1800-100: a kind of metal in the LAN port

    I have an old S1800-100 (about 4-5 years), there is a kind of metal in the front where I (would) attach my ethernet cable. It is a problem since I finally had time to DSL. I'm sure this is a silly question, but it does not mean that I do not have a c

  • migration assistant for only the user folder

    I'm helping a student who left a Time Machine backup College but suffered a hard disk failure in his MacBook Pro here. We can't clone or make a backup hard drive TM or run the recovery partition. All we could do was to copy the user on an external ha

  • Error during installation of Service pack 3 to sql server 2008r2

    I got an error when installing ENU\SQLServer2008R2SP3-KB2979597 - x 64 - ENU.exe He said c:\winows\installer\f1e8c.msi is missing and I'm not able to go forward. The error code is 0x84B20002. The current Version of SQL is SQL 2008R2 RTM. Please advic

  • On the p6610f motherboard will support an AMD Phenom II X 4 975 Black Edition?

    I heard that the default mobo does not support overclocking or 125W processors, are these claims true? Here is a link to the page of processor with more information: http://www.newegg.com/Product/Product.aspx?Item=N82E16819103923