如何避免生成重复的序列号?

huangapple go评论113阅读模式
英文:

How to avoid generating duplicate sequence number?

问题

我需要帮助解决生成序列号时遇到的问题。在付款批准规则期间,我正在生成序列号。然而,每次我完成一笔付款时,都会从检查向导的第三步收到验证/警告消息。如果我尝试再次完成付款,序列工具会生成另一个序列号。这会导致重复和混淆。我该如何防止这种情况发生?如果存在任何验证/警告消息,我希望序列工具停止生成新的序列号。

英文:

I need help with an issue I am facing in generating sequence numbers. I am generating sequence number during payment approval rule. However, every time I complete a payment, I get a validation/warning message from check wizard 3rd step. If I try to complete the payment again, the sequence util generates another sequence number. This is causing duplication and confusion. How can I prevent this from happening? I want the sequence util to stop generating new sequence numbers if there are any validation/warning messages.

答案1

得分: 4

Sequence Util保证唯一的数字,不生成重复的数字。如上所述的情况,如果在单个流程中多次调用,可能会导致未使用的序列号,但不会生成重复的序列号。

请验证是否可以延迟调用Sequence Util,直到所有验证都通过,以避免未使用的序列号。

英文:

Sequence Util guarantees unique numbers and does not generate duplicate numbers. The scenario described above may result in unused sequence numbers if called multiple times during a single flow but do not generate duplicates.

Please verify if you can delay the invocation of Sequence Util until all validations are passed to avoid unused sequence numbers.

答案2

得分: 2

我假设您正在尝试在ClaimCenter的Check向导中创建支票。请告诉我这是否正确。

当从数据库生成新的序列号时,即使支票支付因某些错误而被放弃,也不能重新使用该号码。您可能希望查找导致支付失败的错误根本原因。序列号工具的行为是按设计进行的。一旦生成了支票号码(或任何其他号码),就不应再次使用该号码。

英文:

I am assuming you are trying to create a check from the Check Wizard in ClaimCenter. Please let me know if this is correct.

When a new sequence number is generated from the DB, that number cannot be re-used even if the check payment is abandoned because of some error. You will probably want to find the root cause of the error that is causing the payment to fail. The sequence number util is behaving as designed. Once a check number (or any other number is generated) that number should not be able to be used again.

huangapple
  • 本文由 发表于 2023年6月19日 00:37:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76501566.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定