MapInfo Pro Developers User Group

Expand all | Collapse all

How to solve "Oracle-Error: Allocating OCI Environment handle" in MiPro 17.01?

  • 1.  How to solve "Oracle-Error: Allocating OCI Environment handle" in MiPro 17.01?

    Posted 09-22-2018 12:24

    Hi there,

     

    i'm experiencing a strange Problem here.

     

    I've developed an MS-Access-application in VBA that starts MiPro in the Background via 

     

    Set objMapInfo = CreateObject("Mapinfo.Application.x64")

     

    Now i've three Computers running that app, but it does so only on one machine, on the other two i get this error 

     

     See Attachment

     

    Oracle-Error: Allocating OCI Environment handle.

     

    Searching the Internet i found a short article on the PB Website About that Problem with MiPro 32-Bit, explaining that the Problem may be solved by reinstalling the Oracle Client matching the MiPro-Version. In my case that would mean: reinstall the whole Oracle DB, - no way!

     

    I checked the machines for differences.

     

    All running Windows 10 Pro 64-Bit / 1803 / German / MiPro 15.03 DE / MiPro 17.01 Advanced / Oracle 12.2 32-Bit Instant Client / Oracle 12C Enterprise DB 64-Bit / same MS-Office 32-Bit Version.

    Setup is the same, 32-bit MiPro can Access the Oracle db as well.

    In the path on all machines the 64-bit Oracle bin-path Comes before the 32-bit instant Client path. The Oracle global variables are the same.

     

    On all three machines it's no Problem to load a spatial layer from the local Oracle instance in MiPro 17.01 when started regulary via Windows startmenu, but when i issue the vba-codeline above, on two machines i get that error message instantly, on one of the machines everything runs as expected.

     

    The only difference i was able to find is, that the machine without Errors is running Oracle DB 12.1 while the other failing machines are running 12.2.

     

    I would think that it's quite unprobable that this is the source of this Problem, - but what else?

    Attached you will find an MS-Access Database demonstrating the strangeness of that problem. To make it work you will have to edit the query- and connection-parameters in the function "EO_Get_Value_List" in Module1. The function generates a delimited list of the string values of an oracle table column.

    If you managed to make that work, you can click on the button "Get Oracle Values" on the main form, that will fill the oracle-values listbox.

     

    So, if you now close the database and open it again, you can try to click on the buton "Start MiPro64", that will try to create a MiPro object in the background.

    In my case i get a "General protection fault" some 30 seconds later, and a nice MiPro.dmp file in my temp-Directory.

     

    BUT

     

    if i close the database and open it up again, and click first on the button "Get Oracle Values" and click afterwards on the button "Start MiPro64" the above errormessage appears instantely, and no oralce connection with this instance of MiPro is possible.

     

    After many Hours of searching i'm lost, and any thoughts are highly welcome.

     

    Thanks and have a nice Weekend

     

    Stefan

     

     

    Attachment(s)

    zip
    Test.zip   1K 1 version


  • 2.  RE: How to solve "Oracle-Error: Allocating OCI Environment handle" in MiPro 17.01?

    Posted 09-25-2018 09:57

    Found the solution by myself:

    If you set an ORACLE_HOME-Variable to point to your 64-Bit installation everything works as expected.

    It stays a bit strange, that running MiPro from windows start menu doesn't require this variable to work with oracle spatial layers, but started via COM does.

     

    Anyway, it works now, - great!

    Stefan