public CFSecuritySysClusterBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecuritySysClusterPKey PKey) {
   final String S_ProcName = "lockBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     int SingletonId = PKey.getRequiredSingletonId();
     final String sql = "CALL sp_lock_sysclus( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtLockBuffByPKey == null) {
       stmtLockBuffByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtLockBuffByPKey.setInt(argIdx++, SingletonId);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySysClusterBuff buff = unpackSysClusterResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       return (buff);
     } else {
       return (null);
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public static String formatSysClusterPKeyAttributes(
     String separator, CFSecuritySysClusterPKey pkey) {
   String retval =
       CFLibXmlUtil.formatRequiredInt32(null, "SingletonId", pkey.getRequiredSingletonId());
   return (retval);
 }
 public void deleteSysClusterByIdIdx(
     CFSecurityAuthorization Authorization, CFSecuritySysClusterPKey argKey) {
   deleteSysClusterByIdIdx(Authorization, argKey.getRequiredSingletonId());
 }