I'm creating data source using wsadmin(jython) script. My script ends with AdminConfig.save()
Following is sample script
parentIDs = AdminConfig.getid("/Node:"+nodeName+"/Server:"+serverName+"/JDBCProvider:"+jdbcProviderName+"/")
parentIDList = AdminUtilities.convertToList(parentIDs)
parentID = parentIDList[0]
requiredAttrs = [["name", dataSourceName]]
otherAttrsList = [["jndiName", jndiName], ["description", description], ["authDataAlias", authAlias],["datasourceHelperClassname", 'com.ibm.websphere.rsadapter.GenericDataStoreHelper']]
otherAttrsList=AdminUtilities.convertParamStringToList(otherAttrsList)
newPS=[]
psAttr = [["propertySet", [["resourceProperties", newPS]]]]
finalAttrs = requiredAttrs+otherAttrsList+psAttr
dsExist = AdminConfig.getid("/Node:"+nodeName+"/Server:"+serverName+"/JDBCProvider:"+jdbcProviderName+"/DataSource:"+dataSourceName+"/")
if (len(dsExist) == 0):
newds = AdminConfig.create("DataSource", parentID, finalAttrs)
AdminConfig.save()
Scope of Mydata source is server
Data source gets created fine with above script, and I can see it on websphere console as well.(Also updated in resources.xml) But when the Websphere is restarted, I'm observing that resources.xml gets overwritten. It removes any data source that I've created from wsadmin script. Strange part is any data source created from console(on same scope) is retained in new resources.xml
Am I missing any additional command in my script? (Most of the scripts which I saw from IBM or net do not include any additional command after save, also scripting instructions for console do not include any new command)
Thanks