<?php

/*
name   : lockRequestAP
func   : LOCKをかける
return : ret, handle
*/
function lockRequestAP() {
  $logger = new logger(basename(__FILE__));

  $sdday = null;
  try {
    global $serverUtil;
    global $stringUtil;

    $ktktcd = $_SESSION[$GLOBALS['SYSTEM_NAME_EN']]["LGKTKTCD"];
    $file = $serverUtil->getProjectDir() . "/util/sql/lock/lockRequestAP.sql";
    $logger->info("FILE", $file);
    global $dbutil;
    //条件
    $whereParams["ktktcd"]['in'] = $ktktcd;
    $whereParams["handle"]['out'] = '';
    $whereParams["ret"]['out'] = '';
    $sql = file_get_contents($file);    //sql取得
    $result = $dbutil->call($sql, $whereParams);
$logger->info('lockok>>',$result);
  } catch(userException $ue) {
//    $dbutil->rollback();
  } catch(Exception $e) {
//    $dbutil->rollback();
  }

  return $result;
}

/*
name   : lockReleaseAP
func   : LOCKを解除
io     : $handle
return : ret
*/
function lockReleaseAP( $handle) {
  $logger = new logger(basename(__FILE__));

  $sdday = null;
  try {
    global $serverUtil;
    global $stringUtil;

    $file = $serverUtil->getProjectDir() . "/util/sql/lock/lockReleaseAP.sql";
    $logger->info("FILE", $file);
    global $dbutil;
    //条件
    $whereParams["handle"]['in'] = $handle;
    $sql = file_get_contents($file);    //sql取得
$logger->info($sql, $whereParams);
    $result = $dbutil->call($sql, $whereParams);

  } catch(userException $ue) {
//    $dbutil->rollback();
  } catch(Exception $e) {
//    $dbutil->rollback();
  }

  return $result;
}

?>
