当前位置:网站首页>DEMO:测试接口短时间内接收重复数据创建单据
DEMO:测试接口短时间内接收重复数据创建单据
2022-07-27 22:34:00 【51CTO】
群号:775662808
申请时请提供 城市-模块-昵称,如:北京-ABAP-森林木。
所有群管理严格,严格禁止一切外来链接、招聘、广告等垃圾信息!
如果您觉得这篇干货文章有用,请帮忙转载、分享给更多人,谢谢~
场景:
第三方调用SAP接口,创建单据,如果对方因为某种原因在极短的时间内,使用重复数据连续调用了sap接口,怎样防止重复创建单据。
之前群里聊过这个问题,我把问题抛出来,大家随便聊聊而已。
场景其实挺简单,也很常见,至于怎么实现,无非是什么加锁,加日志之类的。
我也是做了一个简单测试。
场景是推送数据到sap,创建PO。
先创建了个log表:


然后建了个锁


然后写了俩函数,分别是用锁和用log表。
第一个函数
仅仅是测试代码而已。
第二个函数,只是没用锁,自己把 加锁 解锁 注释掉就行了,
(LS_LOG-WEB_ORDER = 'LM00002')。

执行结果:

第一个函数没有重复数据。
第二个函数出现了问题:

大概就是这个意思了。
仅仅是简单测试了下,如果有什么不对的地方欢迎批评指正。谢谢!~
边栏推荐
- Network device hard core technology insider firewall and security gateway (VII) virtualization artifact (Part 1)
- At least 42 employees are infected with novel coronavirus! Nokia announces closure of telecom equipment plant in India
- Operators in MySQL
- Firefox 103, the Firefox browser, has been released to improve performance under high refresh rate displays
- 分支和循环语句题目练习
- SRv6初登场
- Network device hard core technology insider firewall and security gateway (summary)
- Solve maze problem recursively
- 数组相关知识
- 共创文旅新篇章|新起典与国华文旅签订战略合作协议
猜你喜欢

UML类图的六大关系,最佳学习理解方式

Data visualization - White Snake 2: black snake robbery (3)

Read cmake in one article

C语言程序设计 | 单身狗题目讲解

From the second floor to the third floor

福特SUV版“野马”正式下线,安全、舒适一个不落

Red team killer behinder_ V4.0 (ice scorpion 4.0)

C语言程序设计 | offsetof宏的讲解及其模拟实现

《KMP复习 + AC自动机》前传

Jointly create a new chapter in cultural tourism | xinqidian signs a strategic cooperation agreement with Guohua cultural tourism
随机推荐
Examples of application of JMeter in performance testing
startUMl
Recommended system - offline recall: u2tag2i, ICF
R language uses ggplot2 visualization: use ggpattern package to add custom stripe patterns, shadows, stripes, or other patterns or textures to the grouped bar graph
R language evaluates the relative importance of the predictive factors (variables, characteristics) of the regression model, scales the predictive variables of the regression model, and then construct
The most detailed summary of common English terms in the chip industry (quick grasp of graphics and text)
Basic operations of MySQL database (2) --- Based on data table
Recommended system model: DSSM twin tower model for embedded recall
Recommend a Hongmeng instant messaging software "fruit chat", which is a bit awesome!!
小波变换学习笔记
共创文旅新篇章|新起典与国华文旅签订战略合作协议
Database daily question --- day 22: last login
Jerry's prompt sound processing when switching devices [chapter]
Logic of automatic reasoning 09 - automatic theorem proving
计算属性的基本使用
推荐系统-模型:dssm双塔模型做embedding的召回
Byte flybook Human Resource Kit three sides
Network equipment hard core technology insider firewall and security gateway (V) security double repair method
[CruiseControl]Build Result JSP
分支和循环语句题目练习