strage situation while creating datasources through script -- WAS6.0.2.17 - Websphere

This is a discussion on strage situation while creating datasources through script -- WAS6.0.2.17 - Websphere ; Hi, I have a strange situation, when I create a sqlserver datasource through script. The script works well in Base installations and my application also starts fine with out any errors. But when I use the script on ND installation, ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: strage situation while creating datasources through script -- WAS6.0.2.17

  1. strage situation while creating datasources through script -- WAS6.0.2.17

    Hi,
    I have a strange situation, when I create a sqlserver datasource through script.
    The script works well in Base installations and my application also starts fine with out any errors. But when I use the script on ND installation, my application throws following error.

    java.sql.SQLException: [IBM][SQLServer JDBC Driver][SQLServer]Could not find stored procedure 'master..xp_jdbc_open2'.DSRA0010E: SQL State = HY000, Error Code = 2,812DSRA0010E: SQL State = HY000, Error Code = 2,812
    at com.ibm.websphere.jdbc.base.BaseExceptions.createE xception(Unknown Source)

    I have set the correct level of scope in the script for ND environment.
    The Jython snippet looks like:
    ParentJDBCProviderId = AdminConfig.getid('/Cell:'+cellName+'/JDBCProvider:'+jdbcProviderName+'/')
    DataSourceId = AdminConfig.create('DataSource', ParentJDBCProviderId, DataSourceAttrs01)

    The datasource is successfully created but, the application throws errors when it is started.
    And when I create the datasource through console (in ND env), the application starts very clean.
    I'm not able to figure the exact problem.

    -- Please help--
    Thanks,

  2. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Hi, At which level is the JDBC Provider defined (Cell, Node, or Server)? Since you said it works during the base install, I would think that the either the JDBC Provider is defined at the wrong level or the DS attributes you are providing are incorrect.

    Brian

  3. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    In ND env, the JDBCProvider is created at the cell level and here are the ds attributes

    ParentJDBCProviderId = AdminConfig.getid('/Cell:'+cellName+'/JDBCProvider:'+jdbcProviderName+'/')

    DataSourceAttrs01 = [['name', datasourceName], ['jndiName', jndiName], ['description', 'sample_ds']]

    DataSourceId = AdminConfig.create('DataSource', ParentJDBCProviderId, DataSourceAttrs01)

    I can create the whole data source and its J2EEResource Set properties (dbServer, dbPort, database name) successfully. But the application fails during startup. The same thing works very well in Base install.



  4. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Hi, Did you verify if the SQL drivers are in the correct path on the node ??

    Thanks
    Anant


  5. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Hi, Change it from cell level to node level and see if this fixes your problem.

    Brian

  6. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Brian,
    The application starts good when I create the datasource at the Node level scope.
    ParentJDBCProviderId = AdminConfig.getid('/Cell:'+cellName+'/Node:'+nodeName+'/JDBCProvider:'+jdbcProviderNam
    e+'/')

    But the thing is we wont want them at the Node level (the only reason being there are a lot number of nodes and nearly 9 datasources to be created... I understand its not a good practice, but it is the way its in here..)

    1. If I create datasource through Admin Console (manually at cell level), the appl'n starts fine, but if I create them at the CELL LEVEL using script , the appl'n throws error.

    java.sql.SQLException: [IBM][SQLServer JDBC Driver][SQLServer]Could not find stored procedure 'master..xp_jdbc_open2'.DSRA0010E: SQL State = HY000, Error Code = 2,812DSRA0010E: SQL State = HY000, Error Code = 2,812
    at com.ibm.websphere.jdbc.base.BaseExceptions.createE xception(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseExceptions.getExce ption(Unknown Source)

    2. If I create the datasource using script at the Node level, the application starts good.
    I'm not able to understand, where am I doing wrong...

    yes Anant, all the sqldrivers are in place.


  7. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Did you did a node sync in your script when you saved it?

    Brian

  8. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    I experienced this error on some SQL Server versions. When creating a SQL datasource via the WAS Admin Console, you'll notice that certain custom properties are added 'out of the box'. I noticed this error occurred when I didn't supply a enable2Phase custom property in the Jython script. Try adding this line to your script or add the property manually via the console:

    if(dbType == "MSSQL"):
    AdminConfig.create('J2EEResourceProperty', propSet, [['name', 'enable2Phase'], ['value', 'false'], ['type','java.lang.Boolean']])

  9. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Thanks a millian, I was having the same issue and your suggestion solved my problem.

  10. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    Thanks a million, I was having the same issue and your suggestion solved my problem.

  11. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    I should have been more specific in my 1/19/09 post. Here is the entire line for script:

    if(dbType == "MSSQL"):
    AdminConfig.create('J2EEResourceProperty', propSet, [['name', 'enable2Phase'], ['value', 'false'], ['type','java.lang.Boolean']])

  12. Re: strage situation while creating datasources through script --WAS 6.0.2.17

    For some reason most of the parms in my previous posts is getting lost when I submit. But the bottom line is, call this: if(dbType == "MSSQL"):
    AdminConfig.create('J2EEResourceProperty', propSet,

    The third argument to this is the properties (see API). For that send 3 properties: name=enable2Phase, value=false, type=java.lang.Boolean.

+ Reply to Thread