This discussion is archived
2 Replies Latest reply: Jun 18, 2012 11:29 PM by 940552 RSS

Unable to Deploy OCCI Application, Environment Creation Problem

940552 Newbie
Currently Being Moderated
Hi,

I am unable to execute my OCCI application in a target system.

I have done the following deployment steps in the target system.
1) Downloaded "Oracle Instant Client Basic" and "SQLPlus" packages.
2) Added the unzipped location to the system PATH variable.
3) I am able to connect Oracle Server Database using "sqlplus" command.

Problem:
While executing my OCCI application, the oracle environment is not creating. It is giving exception with junk error codes.

"Unable to Create Oracle Environment, └±↕"

Code:
bool CConnection::CreateEnvironment()
{
     try{
          /* create oracle environment */
          m_oOracleEnvironment = oracle::occi::Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
     }catch(oracle::occi::SQLException &e){
          m_StrError = "Unable to Create Oracle Environment, ";
          m_StrError += e.getMessage();
          return false;
     }
     return true;
}

Note: When i am installing "Instant Client" package from the Oracle Client UI setup, it is working fine.

I have searched in the forum, i got the following un-answered links.
cannot create environment in another computer
Re: createEnvironment error

Please, let me know if anything could be added to make work my OCCI application.
  • 1. Re: Unable to Deploy OCCI Application, Environment Creation Problem
    339182 Newbie
    Currently Being Moderated
    You don't mention your OS or compiler. C++ is notoriously inflexible with it comes to libraries. The OCCI libraries must match the compiler you are using for your project.

    For Windows: Double check to ensure your version of MSVC compiler matches the oraocci dll you are using. For example, Oracle 11.2 ships with libraries for msvc 8 and 9. If you are using msvc 10 (Visual Studio 10), you'll need to get the latest occi dlls. You can obtain them from:

    http://www.oracle.com/technetwork/database/occidownloads-083553.html

    For the past couple of years, we've been using a OCCI-MSVCgateway, a "shim" that we place between our C++ application and OCCI. This code is small and efficient, and it decouples our code from OCCI versions. Simply drop the gateway dll (plus the corresponding oraocci dll) in the oracle BIN directory in the PATH. I highly recommend it for any project using OCCI.

    http://gitorious.org/occi-gateway/pages/Home
  • 2. Re: Unable to Deploy OCCI Application, Environment Creation Problem
    940552 Newbie
    Currently Being Moderated
    Hi rubin,

    Thank you very much for answering my question.

    Please find the following details.

    OS : Windows XP SP3
    Compiler : msvc8 (Visual Stdio 2005) compiler.

    I have taken the run-time DLLs from folder "Oracle Instant Client 11.2 --> msvc8".

    Edited by: 937549 on Jun 18, 2012 11:29 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points