투비소프트에서 제공해주는 강의
https://www.youtube.com/watch?v=PArLpGCTpxc&list=PLgoHUQa-ZzHAbNjKAl1DyWDrseM_NxxAG&index=7
Transaction 함수 호출 후 서버에서 응답이 완료되는 시점까지 대기 후 결과를 받으면 다음 스크립트 진행
this.transaction("svcSelect" // 서비스 ID (transaction 구분)
, "http://velog.io/write" // 서비스 URL
, "" // 저장
, 'ds_emp = out_emp // 조회 -> client ds = server ds (서버쪽 데이터를 클라용으로 치환)
, ""
, "fn_callback", false);
// trace 실행되지 않고 transaction 완료까지 대기
trace(ds_emp.getRowCount()); // 서버 건수 확인가능
-> 콜백 함수 부분이 false 면 동기
Transaction 함수 호출 후 통신완료와 상관없이 다음 스크립트를 수행하며, 서버에서 결과를 리턴 받으면 callback 함수가 호출됨
this.transaction("svcSelect"
, "http://velog.io/write"
, ""
, 'ds_emp = out_emp
, ""
, "fn_callback", true);
// 바로 trace 실행문 됨 trace(ds_emp.getRowCount()); // 서버 건수 확인 불가
Ex) this.transaction ("svcSelect", "SvcURL::select_emp.jsp",...
SvcURL:: - Cache -> Prefix Cache 기능 사용가능 (캐시를 이용한 성능 향상)
주로 운영자가 관리하기 때문에 기본값으로 dynamic (동적 환경) 으로 수행 된다.
여러개의 Dataset 전달 시 공백으로 구분하여 처리 - 전달하는 파라미터는 nexacro.wrapQuote(strParameter) 함수 사용
1) this.transaction(svcSelect1","SvcURL::select_code.jsp", "","ds_dept=out_dept", "", "fn_call");
2) this.transaction(svcSelect1","SvcURL::select_code.jsp", "","ds_pos=out_pos", "", "fn_call");
___ 1) 과 2) 를 한 번에 쓰는 방법 (공백을 추가한다 - 아래가 더 빠름)
3) var strParameter = nexacro.wrapQuote('홍길동');
this.transaction("svcSelect1","SvcURL::select_code.jsp", "","ds_dept=out_dept ds_pos=out_pos", "", "fn_call");
* onload, onrowsetchanged, onworposchanged 등 event 객체에 e.reason 이 있는 경우 반드시 분기(if문)처리를 해야함 (이후 설명 다시 합니다)
this.ds_emp_onrowposchanged = function(obj:nexacro.NormalDataset, e:nexacro...)
{
if(e.reason == 12) { // append
} else if(e.reason == 20) { // delete
} else if(e.reason == 30) { // sort
}
}