Discussions

General J2EE: Setting isolation level in WAS5.0 for Informix driver

  1. Hi,

    Does anybody know how to set the isolation level for an informix datasource in WebSphere 5.0 Application server.

    I tried creating a property to datasource with name :
    ifxIFX_ISOLATION_LEVEL to 1.

    Through a simple client program, I looked up the datsource object and printed the isolation level of the object using
    con.getTransactionIsolation(). I got a serializable level
    (4) value for this which is not the value I set for datasource.

    If anyone of you set the isolation level for informix driver datasource in WAS5.0, could you pls let me know.

    Thanks,
    Praveen
  2. In WAS go the the web deployment descriptor and select the
    References tab, then select the resource tab, entering the jndi name, etc and set the isolation level.

    This will auto edit the file ibm-web-bnd.xmi under you WEBINF
    to bind the reference
  3. Hi Howard,

    Thanks for your reply.

    I am not referring the datasource in either servlets or ejbs. I have created the datasource at cell level in WAS ND 5.0

    A standalone client accesses this resource through normal lookup like this:

    ht.put(Context.PROVIDER_URL, "iiop://IPAddress:9811");
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    Context ctx = new InitialContext(ht);
    DataSource ds = (DataSource)PortableRemoteObject.narrow(
                   ctx.lookup("jdbc/DS_JT"),DataSource.class);
    Connection con = ds.getConnection();
    System.out.println("Got Connection::Iso Level:"+ con.getTransactionIsolation());

    and the output is:
    Got Connection::Iso Level:4

    I'm using informix drivers: ifxjdbc.jar & ifxjdbcx.jar

    Do you know why the isolation level is changing automatically at the client side??