Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Diego Salido
RE: Allocation of environment handle failed [ reply ]  
2011-09-22 21:06
I had the same problem, but I just uninstall ibm_db and reinstall with IBM_DB_INCLUDE and IBM_DB_LIB environment variables.

See: /opt/ibm/db2/V9.7/dsdriver/ruby32/README


step 2: - Set the environment variables IBM_DB_INCLUDE and IBM_DB_LIB as below

(assuming bash shell)

export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include or /opt/ibm/db2/v9.5/include)
export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)

By: Ozgun Atacan
RE: Allocation of environment handle failed [ reply ]  
2011-01-11 18:34
Ok I solved the problem by uninstalling first client and reinstalling it with rails user. It looks like an enviromental issue.

Thanks,
Oz.

By: Ozgun Atacan
RE: Allocation of environment handle failed [ reply ]  
2011-01-11 16:38
Hi Praveen,

We are using Client that comes with DB2 Express-C . I tried to turn on CLI but I was unsuccesful. It looks like it is failing before CLI initialization.

It works fine with 9.5 in another machine, this machine has only 9.7 installed.

It seems like it is a user/permissions issue. Is there any directory that ibm_db gem file needs to access after installation?

Thanks,
Oz.

By: Praveen Devarao
RE: Allocation of environment handle failed [ reply ]  
2011-01-11 10:17
Hi Oz,

What client are you using (Runtime Client/DS Driver/Data Server client)?

This error is seen when allocation of the environment handle fails. Which possible would be due to env variable set wrong or not set. Could you turn on the CLI trace and get the trace for me.

Also you mentioned that it is going through fine with V9.5, was this on the same machine or some other? If the gem was built with 9.5 and you are using the same now with 9.7 might be there is some problem due to dynamic linking of the executables, could you re-build it with 9.7 and give a try?

Thanks

Praveen

By: Ozgun Atacan
RE: Allocation of environment handle failed [ reply ]  
2011-01-11 10:01
Hi Praveen, thanks for the reply. The problem is I don't have a db2 instance in the rails box. DB2 is remote.

Thanks,
Oz.

By: Praveen Devarao
RE: Allocation of environment handle failed [ reply ]  
2011-01-11 04:11
Hi Ozgun,

Set the environment variable DB2INSTANCE to name of your instance and you should be able to go through.

Eg: export DB2INSTANCE=db2inst1

Thanks

Praveen

By: Ozgun Atacan
Allocation of environment handle failed [ reply ]  
2011-01-10 17:51
Hi, I have successfully installed ibm_db 2.5.5 using IBM client 9.7-64bit. When I try to access my remote database from my rails 2.3.8 application I get the exception below.

Failed to connect to [DB] due to: uncaught throw `Allocation of environment handle failed: <error message could not be retrieved>'

Moreover I can connect the same database from my local environment using the same version of ibm_db gem but prepared with IBM client 9.5.

Version of my DB is 9.5. According to documents of IBM those version shouldn't be a problem.

Can someone please help me in this issue ?

Thanks