How to Cancel a Concurrent Request Stuck in the Queue?

Subject: How to Cancel a Concurrent Request Stuck in the Queue?
Doc ID: 749748.1 Type: PROBLEM
Modified Date : 02-MAR-2009 Status: MODERATED

In this Document
Symptoms
Cause
Solution
References
--------------------------------------------------------------------------------
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.

Applies to:
Oracle Application Object Library - Version: 11.0 to 12.0
This problem can occur on any platform.
11.0.x - 12.0.x
Symptoms
Unable to cancel a concurrent request out of the queue that is stuck.

Cause
Tried to Cancel a concurrent request. Used the "Cancel Request" button from the Administer > Concurrent > Manager form.

Got the following message:

Request xxxxxx can no longer be cancelled. The Concurrent Manager Process that was running this request has exited abnormally. The ICM will mark this request as completed with error.

Solution
Manually cancel the request out of the queue with the following SQL against the offending
request id(s). This can be safely done while managers are up and running:


SQL> UPDATE fnd_concurrent_requests
SET phase_code = 'C', status_code = 'X'
WHERE request_id = '<request id>';
commit;


Note: To obtain request details prior to cancelling the request, use Note 134035.1 ANALYZEREQ.SQL - Detailed Analysis of One Concurrent Request. When prompted, provide the request id to be analyzed. This can be useful for determining the reason why the request may be stuck in the queue.

转载于:https://www.cnblogs.com/ebs-blog/archive/2009/08/21/2167330.html

### 回答1: GRPC是一个高性能、开源的RPC框架,它使用ProtoBuf作为序列化协议,可以跨语言进行通信。下面是一个使用Python编写的简单GRPC示例: 1. 安装GRPC库: ``` pip install grpcio grpcio-tools ``` 2. 编写.proto文件,定义服务和消息类型。例如: ``` syntax = "proto3"; service Greeter { rpc SayHello (HelloRequest) returns (HelloResponse); } message HelloRequest { string name = 1; } message HelloResponse { string message = 1; } ``` 3. 使用grpcio-tools工具生成Python代码: ``` python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. greeter.proto ``` 4. 编写服务端代码: ```python import time from concurrent import futures import grpc from . import greeter_pb2, greeter_pb2_grpc class Greeter(greeter_pb2_grpc.GreeterServicer): def SayHello(self, request, context): return greeter_pb2.HelloResponse(message='Hello, %s!' % request.name) def serve(): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) greeter_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) server.add_insecure_port('[::]:50051') server.start() try: while True: time.sleep(60*60*24) except KeyboardInterrupt: server.stop(0) if __name__ == '__main__': serve() ``` 5. 编写客户端代码: ```python import grpc from . import greeter_pb2, greeter_pb2_grpc def run(): channel = grpc.insecure_channel('localhost:50051') stub = greeter_pb2_grpc.GreeterStub(channel) response = stub.SayHello(greeter_pb2.HelloRequest(name='world')) print("Greeter client received: " + response.message) ``` 6. 运行服务端和客户端: ``` python server.py ``` 在另一个终端中 ``` python client.py ``` 客户端将 ### 回答2: 使用Python编程通过gRPC网络传输信息的演示如下: 1. 安装gRPC库:首先确保已安装Python和pip,然后使用pip命令安装gRPC库。 ```bash pip install grpcio ``` 2. 创建.proto文件:创建一个名为demo.proto的文件,用于定义gRPC服务的接口和消息格式。 ```protobuf syntax = "proto3"; package demo; service TransferService { rpc TransferData (TransferRequest) returns (TransferResponse) {} } message TransferRequest { string data = 1; } message TransferResponse { string status = 1; } ``` 3. 生成Python代码:使用gRPC工具生成Python代码,将.proto文件转换成可用的Python类。 ```bash python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. demo.proto ``` 4. 实现服务:创建一个名为server.py的Python文件,实现gRPC服务的功能。 ```python import grpc from concurrent import futures import demo_pb2 import demo_pb2_grpc class TransferService(demo_pb2_grpc.TransferServiceServicer): def TransferData(self, request, context): data = request.data response = demo_pb2.TransferResponse() response.status = "Successfully transferred: " + data return response def serve(): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) demo_pb2_grpc.add_TransferServiceServicer_to_server(TransferService(), server) server.add_insecure_port('[::]:50051') server.start() server.wait_for_termination() if __name__ == '__main__': serve() ``` 5. 调用服务:创建一个名为client.py的Python文件,用于调用gRPC服务。 ```python import grpc import demo_pb2 import demo_pb2_grpc def run(): channel = grpc.insecure_channel('localhost:50051') stub = demo_pb2_grpc.TransferServiceStub(channel) response = stub.TransferData(demo_pb2.TransferRequest(data='Test data')) print("Response:", response.status) if __name__ == '__main__': run() ``` 6. 运行代码:分别在两个终端窗口中分别运行server.py和client.py文件,观察输出结果。 这个演示展示了如何使用gRPC在Python编程中通过网络传输信息。在实际应用中,可以根据需要扩展和修改代码来满足具体的业务需求。 ### 回答3: gRPC是一种高性能、开源的远程过程调用(RPC)框架,用于快速有效地在不同的计算机进程或主机之间传输信息。在Python编程中,我们可以使用gRPC来实现信息的传输。 首先,我们需要安装gRPC库,可以使用`pip install grpcio`命令进行安装。 接下来,我们需要定义.proto文件,该文件描述了消息类型和服务接口。在.proto文件中,我们定义了需要传输的信息的结构和方法。 例如,我们创建一个名为`transfer.proto`的.proto文件: ``` syntax = "proto3"; package transfer; service Transfer { rpc SendData (Data) returns (Result) {} } message Data { string message = 1; } message Result { bool success = 1; string message = 2; } ``` 然后,我们使用gRPC提供的工具根据.proto文件生成相应的Python代码,可以使用以下命令: ``` python -m grpc_tools.protoc -I=<proto文件所在目录> --python_out=<生成的Python代码存放目录> --grpc_python_out=<生成的Python代码存放目录> <proto文件> ``` 例如,使用以下命令生成Python代码: ``` python -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. transfer.proto ``` 接下来,我们创建一个服务器端代码,用于接收客户端发送的信息,示例代码如下: ```python from concurrent import futures import grpc import transfer_pb2 import transfer_pb2_grpc class TransferServicer(transfer_pb2_grpc.TransferServicer): def SendData(self, request, context): response = transfer_pb2.Result() response.success = True response.message = "Server received the message: " + request.message return response def serve(): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) transfer_pb2_grpc.add_TransferServicer_to_server(TransferServicer(), server) server.add_insecure_port('[::]:50051') # 监听端口 server.start() server.wait_for_termination() if __name__ == '__main__': serve() ``` 最后,我们创建一个客户端代码,用于向服务器发送信息并接收服务器的响应,示例代码如下: ```python import grpc import transfer_pb2 import transfer_pb2_grpc def send_data(message): channel = grpc.insecure_channel('localhost:50051') stub = transfer_pb2_grpc.TransferStub(channel) response = stub.SendData(transfer_pb2.Data(message=message)) print("Response from server:", response.message) if __name__ == '__main__': send_data("Hello gRPC!") ``` 通过以上代码,我们在Python中成功实现了使用gRPC网络传输信息的示例。服务器端接收客户端发送的信息,并返回相应的响应。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值