이 나는 글래스 피쉬 웹 서비스의 applicationscope에 번호를 저장하기 위해 노력하고있어 글래스 피시 자바저장 변수가
WebService에 : 나는 카운터 변수를 요청할 때
@WebService()
public class datacheck {
//TODO 080 disable sql_log in the settings of hibernate
//TODO 090 check todo's from webservice_1
private int counter = 5;
내가 얻을 5 및
@WebMethod(operationName = "increaseCounter")
public Integer increaseCounter() {
counter++;
return counter;
}
수익률 6하지만 난 이후에이 작업을 수행 할 때 내가 다시 5를 얻을 :
@WebMethod(operationName = "getCounter")
public Integer getCounter() {
return counter;
}
웹 서비스의 모든 메소드에 사용할 수있는 변수를 저장하려면 어떻게해야합니까?
들으을 해달라고에 개체를 제약 조건하려면
도 ThreadLocal있다, 내가 무엇을 찾고 있었다 이잖아. 이것을 시도하고 가능한 동기화 문제를 고려할 것입니다. – Berty