[jboss-user] [IronJacamar] - Re: Trying to create datasource, delete and then create again with same name requires sever restart

Stefano Maestri do-not-reply at jboss.com
Mon Aug 12 11:07:09 EDT 2013


Stefano Maestri [https://community.jboss.org/people/maeste] created the discussion

"Re: Trying to create datasource, delete and then create again with same name requires sever restart"

To view the discussion, visit: https://community.jboss.org/message/832348#832348

--------------------------------------------------------------
The issue is about something else, and fixed a different problem generating an exception during :remove operation on RA, you are asking to remove and re-add subresources of resource-adapter w/o server reload.
It's not currently supported. You can't change the structure af an RA resource w/o a server reload.

What you can do (because supported) is to edit attributes marked as read-write. Of course you can't edit read-only attributes. In particular you can't add a connection-definition/config-property's value (if I well remember is one of few, if not the only one, attribute marked read only)

What we support is a full remove of ra and resource and readd it. IOW these scripts are not supported (w/o server reload):

> #Add resource-adapter
> /subsystem=resource-adapters/resource-adapter=ws:add(module=org.jboss.teiid.resource-adapter.webservice, transaction-support=NoTransaction)
> 
> #Add a connection factory
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
> 
> #remove the added connection factory
> /subsystem=resource-adapters/resource-adapter=ws:remove
> 
> #Add the same *named* connection factory again to RA
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
because it is changing structure of resource-adapter main resource removing and readding connection-definition.

Next script is not working too (w/o server reload) for the same reason:

> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS/config-properties=EndPoint:add(value= http://foo.com/ http://foo.com)
> /subsystem=resource-adapters/resource-adapter=ws:activate
> 
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS/config-properties=EndPoint:remove
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS/config-properties=EndPoint:add(value= http://foo1.com/ http://foo1.com)


What should work is 

> #Add resource-adapter
> /subsystem=resource-adapters/resource-adapter=ws:add(module=org.jboss.teiid.resource-adapter.webservice, transaction-support=NoTransaction)
> 
> #Add a connection factory
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
> #Add a config-property if need
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS/config-properties=EndPoint:add(value= http://foo1.com/ http://foo1.com)
> 
> #Activate the resource-adapter to apply config
> /subsystem=resource-adapters/resource-adapter=ws:activate
> 
> #remove complegtely  added Resource
> /subsystem=resource-adapters/resource-adapter=ws:remove
> 
> #Add the same *named* resource-adapter again
> /subsystem=resource-adapters/resource-adapter=ws:add(module=org.jboss.teiid.resource-adapter.webservice, transaction-support=NoTransaction)
> 
> #Add the same *named* connection factory again to RA
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
> 
> #Add again aconfig-property if need
> /subsystem=resource-adapters/resource-adapter=ws/connection-definitions=wsDS/config-properties=EndPoint:add(value= http://foo1.com/ http://MyNewfoo.com)
> 
> #Activate the resource-adapter to apply NEW config
> /subsystem=resource-adapters/resource-adapter=ws:activate

And the issue fixed in jira linked is about a script like the last one, generating an error during resource-adapter:remove operation.

I hope it helps.

regards
S.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832348#832348]

Start a new discussion in IronJacamar at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130812/5d98df2b/attachment.html 


More information about the jboss-user mailing list