Problem solved.
We shouldn't use EXEC (:var_commit) and EXEC (:var_rollback) while calling the procedure from xsjs. They are working fine while we are calling the procedure from SQL Console but if we call them from xsjs in some way they are locking the tables and xsjs is not getting any response from procedure. Removing these lines solved the problem.