Question

Our J2EE based application is run on Websphere Applicaiton Server- AIX server with 2 versions of DB2 Client installed (Db2v9.5, Db2v9.7).

I have a db SAMPLE which is remotely cataloged in both the two DB2 client versions with the same alias name SAMPLE.

If I uncatalog the DB from DB2v9.5 , the application goes down. However if I drop it from DB2v9.7 client the application is not impacted.

From this above test , we understand that some how DB2v9.5 is being used by default.

My objective now is to make the SAMPLE be pointed to only DB2v9.7 and the App must work without the sample DB in DB2v9.5.

Any suggestions on how to do it ?

The JDBC string used is "jdbc:db2:sample" (Note: there is no port for DB2 Client)

I have already tried to point $LIBPATH & $LD_LIBRARY_PATH to DB2v9.7 native lib32 path, and also pointed the AIX user ID's .profile to DB2v9.7/sqllib/db2profile ,But no luck.

Regards, Chandru

Was it helpful?

Solution 3

This issue was resolved by completely killing all the JVM that is running from the same version and path of java and starting them back. (In our case an AIX JVM pConsole was running behind even after putting Dmgr,Node & CL down. Both pConsole and WAS uses the same java)

That was the reason that the updated shared native libraries didn't reflect in the WAS. But after killing&starting back each instance of java, including the ones apart from WAS the native libraries got reflected in the logs .

Sorry about updating the answer after so long.

OTHER TIPS

You have to check the default environment where Java is running, you will detect which Client is using. You could do that by executing "env" via Runtime, and see the defaults.

For example, with a small app like this:

import java.lang.*;
import java.io.*;

public class Test {
 public static void main (String[] args) throws Exception {
  Process p = Runtime.getRuntime().exec("env");
  String line;
  BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
  while ((line = input.readLine()) != null) {
    System.out.println(line);
  }
  input.close();
  System.out.println("library " + System.getProperty("java.library.path"));
 }
}

You call it with the same parameters you call your other application (JDBC driver included), and then check the output.

java <your params, classpath to db2java.zip> Test

Check the parameters like DB2INSTANCE, PATH, CLASSPATH.

More information in http://www.ibm.com/developerworks/data/library/techarticle/dm-0512kokkat/

List the files in /usr/lib and /usr/include. Do you see any file that points to DB2?

ls -l /usr/lib
ls -l /usr/include

Probably, you executed a db2ln, and that created links to a specific DB2 Client (9.5). Each time you execute the Java application, the LIBPATH takes precedence over /usr/lib, than the specified DB2 version

LIBPATH=/usr/lib:/lib:/opt/IBM/db2/V9.7/lib32

You can run the db2rmln command to remove the links.

Take a look at this page: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.qb.server.doc/doc/t0006747.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top