Are JBossWS webservices threadsafe?
Issue
- We are converting from Websphere and our webservice is behaving differently on JBoss which makes us wonder if JBossWS is not thread safe.
Here is a simple web service example:
@WebService
public class TestWS {
private String myName = "Test";
@WebMethod
public void doSomething() {
myName = myName + ".";
}
@WebMethod
public String getSvcName() {
return myName;
}
}
In this example the class variable myName keeps changing with each invocation of doSomething() method. This behavior makes the web service thread unsafe.
Environment
- JBoss Enterprise Application Server (EAP) 6.x
- JBoss Enterprise Application Server (EAP) 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.