OpenTP1 Version 7 Programming Reference C Language

[Contents][Index][Back][Next]

dc_rpc_call - Request a remote service

Format

ANSI C, C++

#include <dcrpc.h>
int  dc_rpc_call (char *group, char *service, char *in,
                  DCULONG *in_len, char *out,
                  DCULONG *out_len, DCLONG flags)

K&R C

#include <dcrpc.h>
int  dc_rpc_call (group, service, in, in_len, out, out_len,
                  flags)
char       *group;
char       *service;
char       *in;
DCULONG    *in_len;
char       *out;
DCULONG    *out_len;
DCLONG     flags;

Description

The function dc_rpc_call() requests an SPP service. This function can be called without consideration of the node containing the requesting service.

Specify a service group name and service name as arguments of the function dc_rpc_call() to request a service. A service request is addressed to the service function corresponding to the specified names.

A UAP which calls the function dc_rpc_call() can be used regardless of whether it has been executed as a transaction. When a service is requested by the function dc_rpc_call() from the process which has been executed as a transaction, the requested service process runs as a transaction branch.

Before this function can be used, the OpenTP1 at the node containing the server UAP to which the service request is addressed must be active.

Receiving a signal while waiting for a response after execution of the function dc_rpc_call() does not cause the function to be returned.

The following items are described after the list of return values. See each description For details on the function dc_rpc_call().

(1) Arguments of the function dc_rpc_call()

(2) Error cases of the function dc_rpc_call()

(3) Timing when the function dc_rpc_call() results in error

(4) Specification for reexecuting the service request if the function dc_rpc_call() results in error

(5) When a priority is given to a service request

(6) Difference between return values DCRPCER_NO_SUCH_SERVICE_GROUP and DCRPCER_NET_DOWN

(7) Specification for returning the value DCRPCER_SERVICE_TERMINATED

(8) Relationship between return values and synchronization point processing

(9) Notes on requesting a service

(10) When a service is requested with domain qualification

Arguments whose values are set in the UAP

group

Specify the SPP service group name with an ASCII character string of up to 31 bytes. End the character string with a null character. The null character is not counted in the length of the character string.

When requesting a service with domain qualification, specify the service group name suffixed by an at mark (@) and the DNS domain name, and end the character string with a null character.

service

Specify the SPP service name with an ASCII character string of up to 31 bytes. End the character string with a null character. The null character is not counted in the length of the character string.

in

Specify the input parameter of the service.

in_len

Specify the input parameter length of the service within the range from 1 to DCRPC_MAX_MESSAGE_SIZE#. DCRPC_MAX_MESSAGE_SIZE is defined in dcrpc.h.

#: If you used the rpc_max_message_size operand, the value of this data area is the value specified in the rpc_max_message_size operand and not the value of DCRPC_MAX_MESSAGE_SIZE (1 megabyte).

out

Specify the area for the response from the service function. This area will receive the response from the service function.

out_len

Specify the length of the response from the service function within the range from 1 to DCRPC_MAX_MESSAGE_SIZE#. DCRPC_MAX_MESSAGE_SIZE is defined in dcrpc.h.

#: If you used the rpc_max_message_size operand, the value of this data area is the value specified in the rpc_max_message_size operand and not the value of DCRPC_MAX_MESSAGE_SIZE (1 megabyte).

Even if the RPC is the non response-type, you must specify the address of the area for which the length of the response from the service is specified. If it is, the length of the response from the service must be 0.

flags

Specify the RPC mode and option in the following format:

{DCNOFLAGS|DCRPC_NOWAIT|DCRPC_NOREPLY|DCRPC_CHAINED}
[|DCRPC_TPNOTRAN][|DCRPC_DOMAIN]

DCNOFLAGS
Synchronous response-type RPC

DCRPC_NOWAIT
Asynchronous response-type RPC

DCRPC_NOREPLY
Nonresponse-type RPC

DCRPC_CHAINED
Chained RPC

DCRPC_TPNOTRAN
Specify this option not to handle the requested processing as a transaction. When DCRPC_TPNOTRAN is specified, the processing of the service function is not handled as a transaction even if the service is requested from the transaction.

DCRPC_DOMAIN
Specify this option when the service group name is specified with domain qualification. An RPC with domain qualification cannot be a transaction branch. Therefore, specify this option together with DCRPC_TPNOTRAN whenever the function dc_rpc_call() is used from the transaction.

Specify DCRPC_TPNOTRAN and/or DCRPC_DOMAIN together with the RPC mode.

Example 1:
When a nontransaction service is requested by using a synchronous response-type RPC, specify for flags as follows:
DCNOFLAGS|DCRPC_TPNOTRAN

Example 2:
When a service is requested by using a synchronous response-type RPC with domain qualification from the transaction, specify for flags as follows:
DCNOFLAGS|DCRPC_TPNOTRAN|DCRPC_DOMAIN

Arguments whose values are returned from server UAP

out

The response set by the service function is returned.

out_len

The length of the response set by the service function is returned.

Return values

The following return values are returned from the OpenTP1, not from the service function.

Return value Return value (numeric) Explanation
0 or positive integer Normal termination. In the case of asynchronous response-type RPC, the positive integer is the descriptor.
DCRPCER_INVALID_ARGS -301 The value specified for the argument is invalid.
DCRPCER_PROTO -302 The function dc_rpc_open() was not called.
DCRPCER_NO_BUFS -304 A memory shortage occurred. Or, a service request was not accepted because a space shortage occurred in the message storage buffer pool (message_store_buflen operand) of the SPP to which the service was requested.
If necessary, revise the message_store_buflen operand in the user service default definition or in the user service definition of the SPP to which the service was requested.
DCRPCER_NET_DOWN -306 A communication failure occurred.
Check if a network failure has occurred.
DCRPCER_TIMED_OUT -307 The response wait time in the dc_rpc_call() function has elapsed.
If necessary, revise the response wait time specified in the dc_rpc_call() function (watch_time operand and arguments in the dc_rpc_set_watch_time() function).
The SPP to which the service was requested terminated abnormally during execution of a service function.
Check the cause of abnormal termination of the SPP to which the service was requested.
DCRPCER_MESSAGE_TOO_BIG -308 The input parameter length specified in in_len exceeded the maximum.
If necessary, revise the in_len setting.
DCRPCER_REPLY_TOO_BIG -309 The length of the response (out_len) set in the service function of the SPP to which the service was requested exceeded the response length (out_len) in the dc_rpc_call() function.
If necessary, revise the response length (out_len) set in the service function of the SPP to which the service was requested.
DCRPCER_NO_SUCH_SERVICE_GROUP -310 The service group name set in group is invalid, or the SPP to which the service was requested with the service group set in group was not running.
If necessary, revise the group setting, or start the SPP to which the service was requested with the service group set in group.
DCRPCER_NO_SUCH_SERVICE -311 The service name set in service is invalid, or the service name set in service by the SPP to which the service was requested has not been specified in the service operand in the user service definition file.
If necessary, revise the service setting, or specify the service name set in service also in the service operand for the SPP to which the service was requested.
DCRPCER_SERVICE_CLOSED -312 The SPP to which the service was requested with the service group set in group is under server shutdown or service shutdown status.
Check the cause of the shutdown, and then release the SPP from shutdown status.
DCRPCER_SERVICE_TERMINATING -313 The SPP to which the service was requested is under termination processing.
DCRPCER_SERVICE_NOT_UP -314 The SPP to which the service was requested with the service group set in group is not running, or a communication failure might have occurred during the service request send processing.
Start the SPP to which the service was requested with the service group set in group. If the SPP is already running, check to see if a network failure has occurred.
While 0 was specified for the service request response time (watch_time operand and an argument in the dc_rpc_set_watch_time() function), the SPP to which the service was requested terminated abnormally during execution of a service function.
Check the cause of abnormal termination of the SPP to which the service was requested.
DCRPCER_OLTF_NOT_UP -315 OpenTP1 for the SPP to which the service was requested is not running. OpenTP1 might be under termination processing or a communication failure might have occurred during the service request send processing.
Start OpenTP1 for the SPP to which the service was requested, or check for a network failure.
DCRPCER_SYSERR_AT_SERVER -316 A system error (internal conflict) occurred in the SPP to which the service was requested.
DCRPCER_NO_BUFS_AT_SERVER -317 A memory shortage occurred in the SPP to which the service was requested.
DCRPCER_SYSERR -318 A system error (internal conflict) occurred in the UAP that requested the service.
DCRPCER_INVALID_REPLY -319 The response length (out_len) set by a service function of the SPP to which the service was requested is outside the range from 1 to the value defined in DCRPC_MAX_MESSAGE_SIZE.#
If necessary, revise the response length (out_len) in the service function of the SPP to which the service was requested.
DCRPCER_OLTF_INITIALIZING -320 OpenTP1 for the SPP to which the service was requested is under start processing.
DCRPCER_NO_BUFS_RB -323 A memory shortage occurred in the UAP that is requesting the service or the SPP to which the service was requested. When this value is returned, the transaction branch rolls back.
Check whether unneeded memory was allocated by the UAP that is requesting the service, or by the SPP to which the service was requested.
DCRPCER_SYSERR_RB -324 A system error (internal conflict) occurred in the UAP that requested the service. When this value is returned, the transaction branch rolls back.
DCRPCER_SYSERR_AT_SERVER_RB -325 A system error (internal conflict) occurred in the SPP to which the service was requested. When this value is returned, the transaction branch rolls back.
DCRPCER_REPLY_TOO_BIG_RB -326 The response length (out_len) set in the service function of the SPP to which the service was requested exceeded the response length (out_len) in the dc_rpc_call() function. When this value is returned, the transaction branch rolls back.
If necessary, revise the response length (out_len) set in the service function of the SPP to which the service was requested.
DCRPCER_TRNCHK -327 When the inter-node load-balancing facility and the extended internode load-balancing facility are used, the transaction attributes (atomic_update operand) do not match among the SPPs with the same service group name to which the service was requested. Another possibility is that the inter-node load-balancing facility and the extended internode load-balancing facility cannot be used because the version of OpenTP1 at the node to which loads are to be distributed is earlier than that of the OpenTP1 for the UAP that is requesting the service.
This value is returned only when the service request is issued to an SPP that uses the inter-node load-balancing facility and the extended internode load-balancing facility.
If necessary, revise the transaction attribute (atomic_update operand) of the SPP that uses the inter-node load-balancing facility and the extended internode load-balancing facility, or revise if necessary the version of OpenTP1.
The dcsvgdef definition command was used to issue a service request to a user server with the non-transaction attribute (the atomic_update operand is N in the user service definition or the jnl_fileless_option operand is Y in the system common definition), but a disjunction with DCRPC_TPNOTRAN was not specified in the flags argument of the dc_rpc_call() function.
If necessary, revise the dcsvgdef definition command or the flags argument of the dc_rpc_call() function.
DCRPCER_NO_SUCH_DOMAIN -328 The domain name of the service group name with the domain qualification in group is invalid.
If necessary, revise the domain name.
DCRPCER_NO_PORT -329 A service was requested with a domain qualification in group, but the port number of the domain representative schedule service was not found.
If necessary, revise the domain_masters_port operand setting in the system common definition and the port number setting for the domain representative schedule service in /etc/services.
DCRPCER_SERVER_BUSY -356 The SPP to which the service was requested (on a server that receives requests through a socket) cannot receive the service request.
If necessary, revise the max_socket_msg and max_socket_msglen operands in the user service definition or the user service default definition for the SPP to which the service was requested.
DCRPCER_TESTMODE -366 When the online tester was being used, a service request was issued from a UAP in the test mode to an SPP in the nontest mode or from a UAP in the nontest mode to an SPP in the test mode.
If necessary, revise the UAP's test mode setting.
DCRPCER_NOT_TRN_EXTEND -367 The dc_rpc_call() function with DCRPC_TPNOTRAN set in flags was called to request a service after a chained RPC with the transaction attribute was executed.
DCRPCER_SECCHK -370 The SPP to which the service was requested is protected by the security facility.
The UAP that requested the service by executing the dc_rpc_call() function does not have permission to access the SPP to which the service was requested. If necessary, revise the access permissions for the SPP to which the service was requested.
DCRPCER_TRNCHK_EXTEND -372 The transaction branch cannot be started because it exceeds the maximum number of transaction branches that can be activated concurrently in the OpenTP1 for the SPP to which the service was requested.
If necessary, revise the setting in the trn_tran_process_count operand in the transaction service definition.
The transaction branch cannot be started because it exceeds the maximum number of child transaction branches that can be activated from one transaction branch by the UAP that is requesting the service.
If necessary, revise the setting in the trn_max_subordinate_count operand in the transaction service definition.
DCRPC_TPNOTRAN is not specified for flags when a service with domain qualification specified in a transaction is requested.
Transaction branching cannot start because the SPP to which the service was requested encountered a resource manager (RM) error.
Eliminate the cause of the resource manager (RM) error, and then re-execute the function.
In the System Environment window of TP1/LiNK, the Transaction Facility item is not set to Yes.
If necessary, revise the Transaction Facility setting in the System Environment window of TP1/LiNK.
DCRPCER_SERVICE_TERMINATED -378 The SPP to which the service was requested terminated abnormally during service function execution.
If necessary, revise the service function processing of the SPP to which the service was requested. This value is returned only for a UAP that was requesting a service for which 00000001 was specified in the rpc_extend_function operand in the user service definition. If 0000000 is specified in the rpc_extend_function operand or if the operand is omitted, DCRPCER_TIMED_OUT or DCRPCER_SERVICE_NOT_UP is returned rather than this value.

#: If you used the rpc_max_message_size operand, the value of this data area is the value specified in the rpc_max_message_size operand and not the value of DCRPC_MAX_MESSAGE_SIZE (1 megabyte).

(1) Arguments of the function dc_rpc_call()

Arguments of the function dc_rpc_call() are explained below.

Values passed to server UAP

Allocate an area (out) for the response from the service function before requesting a service. The client UAP sets the following values in the function dc_rpc_call().

Values returned from server UAP

When the service function terminates and response is returned, the following values can be referenced:

The value of out_len is the length of the response which is actually returned from the service function. The values of out and out_len can be referenced in the following cases depending on the RPC mode:

If the function dc_rpc_call() or dc_rpc_poll_any_replies() returns with an error, the values of out and out_len cannot be referenced.

If the returned response is larger than the response area acquired by the client UAP, the function returns with an error, giving the return value DCRPCER_REPLY_TOO_BIG.

Value specified for flags

The value specified for flags and the execution result of the function dc_rpc_call() are explained below.

There are the following restrictions on the use of chained RPCs:

  1. The shutdown state of the user server or service cannot be detected by the second and subsequent calls of the function dc_rpc_call().
  2. The entire user server enters in shutdown state if an error occurs during the service function processing of the second and subsequent calls of the function dc_rpc_call(). Services do not enter in shutdown state individually.

(2) Error cases of the function dc_rpc_call()

Reasons why the function dc_rpc_call() returns with an error are explained below.

If the OpenTP1 at the node containing the server UAP is not active

If the OpenTP1 to which the service request is addressed is not active, the function dc_rpc_call() returns with an error, giving one of the following return values:

If the server UAP is not active

When the server UAP is a multiserver, the service request is dealt with a new process which is activated by the OpenTP1 even if the server UAP is being terminated abnormally or being partially recovered. However, the function dc_rpc_call() returns with an error in the following cases:

  1. No service request can be addressed to the SPP in shutdown state. If the service group is shut down, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_SERVICE_CLOSED.
  2. If the SPP is being terminated or has been terminated by the stop command for the user server (dcsvstop command) or for OpenTP1 (dcstop command), the dc_rpc_call() function returns with an error and sets one of the following status code values:
    • DCRPCER_SERVICE_TERMINATING
    • DCRPCER_SERVICE_CLOSED
    • DCRPCER_NO_SUCH_SERVICE_GROUP
    The value that is returned depends on the timing of calling the dc_rpc_call() function.
  3. If the OpenTP1 is being started, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_OLTF_INITIALIZING. In this case, a service may be requested normally after activation of the server UAP or OpenTP1 is completed. Since activation of the OpenTP1 is completed when a message log with the message ID KFCA01809-I is output, request a service again after this message appears.

When a service is requested in the environment for the internode load-balancing facility and the extended internode load-balancing facility

In the environment for the internode load-balancing facility and the extended internode load-balancing facility, if the schedule of the applicable service is closed, OpenTP1 automatically transfers a service request to another node. However, the function dc_rpc_call returns DCRPCER_TRNCHK, and control is returned due to an error under either of the following conditions:

  1. For transaction processing, the transaction attribute of the service on the transfer destination node does not match the closed service.
  2. The version of the OpenTP1 on the transfer destination node is earlier than that of the node for the OpenTP1 that requested the service.

When control is returned as a result of the foregoing error, take the following actions:

  1. Force the transaction attributes of the SPPs making up the internode load-balancing facility and the extended internode load-balancing facility to match.
  2. Force the OpenTP1 versions making up the internode load-balancing facility and the extended internode load-balancing facility to match.

When a service request is addressed to the server that receives requests from socket

The server that receives requests from socket controls message congestion according to the specified values for max_socket_msg and max_socket_msglen in the user service definition. It is probable that service requests cannot be accepted if a message exceeds the defined value. In this case, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_SERVER_BUSY. If this value is returned, the client UAP can sometimes reissue the service request successfully after waiting for a while.

When a chained RPC is used

If the function dc_rpc_call() which is not a transaction is called from the UAP using a chained RPC which is processed as a transaction to the same server UAP, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_NOT_TRN_EXTEND.

When the online tester is used

If the online tester is in use and the function dc_rpc_call() is called from a UAP in test mode to a UAP in nontest mode or vice versa, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_TESTMODE.

When the security facility is used

If the desired service is protected with the security facility when the function dc_rpc_call() is called and the client UAP which called the function does not have the access permission for the SPP, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_SECCHK.

(3) Timing when the function dc_rpc_call() results in error

The following explains the timing when an error is returned to the client UAP if the SPP to which the service request is addressed terminates abnormally.

When the function dc_rpc_call() results in error due to time monitoring of the client UAP

In the following cases, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_TIMED_OUT, after the time specified in the watch_time operand in the user service definition of the client UAP has elapsed:

(4) Specification for reexecuting the service request if the function dc_rpc_call() results in error

Even if the OpenTP1 to which the service request is issued is not active because it is being started or is engaged in system switching, you can have the OpenTP1 re-execute the requested search and service request transmission without treating the dc_rpc_call() function processing as an error.

To re-execute the requested search and service request transmission, specify Y in the rpc_retry operand in the system common definition. You use the rpc_retry_count and rpc_retry_interval operands to specify the re-execution count and re-execution interval, respectively, for a requested search and service request transmission. If this count value exceeds the re-execution count value specified in the system common definition, the dc_rpc_call() function returns with an error and sets one of the following status code values:

(5) When a priority is given to a service request

To specify a schedule priority for a service request, call the function dc_rpc_set_service_prio() immediately before the function dc_rpc_call(). If no schedule priority is specified, the priority of the service request is determined according to the default interpretation of the schedule service.

(6) Difference between return values DCRPCER_NO_SUCH_SERVICE_GROUP and DCRPCER_NET_DOWN

These return values are returned if the user server corresponding to the service group name is not found.

(7) Specification for returning the value DCRPCER_SERVICE_TERMINATED

You may want to determine whether the SPP that requested a service terminated abnormally before completion of processing based on a returned value other than DCRPCER_TIMED_OUT or DCRPCER_SERVICE_NOT_UP. If so, specify 00000001 in the rpc_extend_function operand of the user service definition. This specification returns DCRPCER_SERVICE_TERMINATED if the above error occurs. If 00000000 is specified in the rpc_extend_function operand, or the operand is omitted, DCRPCER_TIMED_OUT or DCRPCER_SERVICE _NOT_UP is returned rather than DCRPCER_SERVICE_TERMINATED.

(8) Relationship between error return values and synchronization point processing

The relationship between return values of the function dc_rpc_call() and synchronization point processing (commitment and rollback) is explained below. The description applies to the service request which is a transaction, rather than the service request which is not a transaction (including the case when DCRPC_TPNOTRAN is specified for flags).

When commitment is performed even though the function dc_rpc_call() returns with an error

The return value DCRPCER_TIMED_OUT may be returned due to abnormal termination of the service function which the service request is addressed, a node error, or network error. However, when the client UAP is not a transaction, the service function to which the service request is addressed may terminate normally and database may be updated.

Error return values which require rollback processing

If the function dc_rpc_call() called from a transaction returns with an error, some return values always require rollback processing for the transaction (the server UAP enters rollback_only state). In this case, rollback processing is always performed even if either of the commitment function or rollback function is used. The following return values of the function dc_rpc_call() always require rollback processing for the transaction:

(9) Notes on requesting a service

  1. Define the service group name and service name at server UAP environment setup. These names are set in the function dc_rpc_call(). If a service is requested while invalid service group name or service name is set in the function dc_rpc_call(), the function returns with an error, giving the return value DCRPCER_NO_SUCH_SERVICE_GROUP or DCRPCER_NO_SUCH_SERVICE. If the service function does not return response, the function dc_rpc_call() does not return with an error, giving the return value DCRPCER_NO_SUCH_SERVICE.
  2. The process of the server UAP is different from that of the client UAP. Therefore, the following matters are different from ordinary function calls and procedure calls:
    • Attributes (such as environment variables, schedule priority (nice value)) which are given to the process of the client UAP by the OS are not passed on to the server UAP.
    • Environment settings (such as existence of specification of transaction attribute, time limit of transaction branch, schedule priority) of the OpenTP1 specified at the node of the client UAP are not passed on to the OpenTP1 of the server UAP.
  3. Do not specify the same buffer area for the input parameter (in) and the response from the service function (out).
  4. If DCRPC_NOREPLY is specified for flags, the following return values will not return:
    • Errors which never occur
      DCRPCER_REPLY_TOO_BIG
      DCRPCER_INVALID_REPLY
    • Errors which cannot be detected even though they could occur
      DCRPCER_NO_SUCH_SERVICE
      DCRPCER_SERVICE_CLOSED
      DCRPCER_SERVICE_TERMINATING
      DCRPCER_SYSERR_AT_SERVER
      DCRPCER_NO_BUFS_AT_SERVER
      DCRPCER_OLTF_INITIALIZING
      DCRPCER_SECCHK
    In addition, OpenTP1 does not output a message when an error occurs. If errors must be detected, consider specifying DCNOFLAGS for flags (synchronous-response-type RPC).
  5. When a service group is requested by the function dc_rpc_call() from a transaction, an SPP is occupied until the transaction terminates. When the same service is requested more than once by the function dc_rpc_call() from one transaction, do the following:
    • Re-estimate the values specified for the balance_count operand and parallel_count operand in the user service definition according to the number of usages.
    • Request a service by using chained RPCs so that the number of processes will not increase.
    If the values specified for the balance_count operand and parallel_count operand are incorrect, the transaction will shut down abnormally and a deadlock may occur.
  6. When an asynchronous response-type RPC is used, the server UAP may be occupied until the function dc_rpc_poll_any_replies() receives all asynchronous responses or the function dc_rpc_discard_further_replies() rejects the receiving of asynchronous responses. This may occur regardless of whether it is a transaction or not. Increase the number of resident processes according to how many times an asynchronous response-type RPC is used.
    An asynchronous response-type RPC requires many resources in addition to occupying the server UAP. To prevent responses from degrading performance of UAP processing and activation of unnecessary SPPs, ensure that responses are received or the receiving of responses is rejected after the function dc_rpc_call() of an asynchronous response-type RPC is used.
  7. When a response is received after an asynchronous response-type RPC is used twice or more consecutively, specify a separate response storage area (out) for each. If the same area is specified, a correct response cannot be received since the second and succeeding responses override the area.
  8. The server UAP (SPP) that requested a service using an asynchronous response-type RPC sends a response soon after the service function is executed, regardless of whether the process that executed the asynchronous response-type RPC issued the function dc_rpc_poll_any_replies. If the same asynchronous response-type RPC is executed numerous times simultaneously without the function dc_rpc_poll_any_replies being issued, the response sent by the SPP may stay in the TCP/IP buffer and the SPP may fail to send a response. If the SPP fails to send a response, no response can be received from the SPP even if the source of the asynchronous response-type RPC issues the function dc_rpc_poll_any_replies.
  9. If a large number of asynchronous response-type RPCs or non-response type RPCs having the transaction attribute are executed, messages about transactions sent by the SPP can no longer be received. In this case, the transactions may roll back.

(10) When a service is requested with domain qualification

Specifying a service group name with domain qualification enables requesting an OpenTP1 service in the DNS domain. Specify the service group name suffixed by an at mark (@) and the DNS domain name for domain qualification.

Notes on requesting a service with domain qualification

  1. To request a service with domain qualification, specify DCRPC_DOMAIN for flags of the function dc_rpc_call(). If the service group name with domain qualification is specified without DCRPC_DOMAIN, the function dc_rpc_call() returns with an error, giving the return value DCRPCER_NO_SUCH_SERVICE_GROUP.
  2. If an RPC with domain qualification is used, a transaction cannot be extended even if the process which called the function dc_rpc_call() is a transaction. Therefore, to request a service with domain qualification from a transaction, specify DCRPC_NOTRAN for flags not to extend the transaction. When the local domain is specified for the domain name, the transaction also cannot be extended.
  3. When an RPC with domain qualification is used, a service request can be addressed only to a server that receives requests from queue, rather than a server that receives requests from socket.
  4. A service request with domain qualification is sent to the domain-alternate schedule service which is activated on the host registered with the namdomainsetup command. Obtain the port number of the domain-alternate schedule service from /etc/services. If an error occurs while transferring the service request and multiple host names are registered with the namdomainsetup command, transfer of the service request is attempted to other hosts sequentially. Even if the RPC with domain qualification terminates normally, an error may occur during transfer to the domain-alternate schedule service.

Preparation for requesting a service with domain qualification

Perform the following environment setup for an RPC with domain qualification:

  1. Register the name of the host on which the domain alternate schedule service is activated in the DNS domain data file by using the namdomainsetup command.
  2. Define the port number of the domain alternate schedule service in /etc/services of the host on which the OpenTP1 which requests a service with domain qualification is activated as follows:
    OpenTP1scd port-number/tcp
  3. Specify the well-known port of the domain alternate schedule service for the scd_port operand in the schedule service definition for the OpenTP1 which activates the domain-alternate schedule service.

Note

Assume that you want to perform a transactional RPC on an OpenTP1 system other than the domain specified in the all_node clause of the system common definition. In this case, you must ensure that the node identifiers (node_id clause of the system common definition) of all OpenTP1 systems in the local domain and remote domain are unique. In addition, all the OpenTP1 systems must be version 03-02 or later. If these conditions are not met, the transaction may not recover properly.