I have a servlet that creates a header with a particular documentno and later creates a line with the same documentno in another file. The problem arises when two people access the same module at the same time. The documentno gets overridden in the lines with the new incremented documentno. How do i tackle this? The doPost method calls another methods to create header and lines. Any help at the earliest would be appriciated.

有帮助吗?

解决方案

To Over come this problem we have an openbravo function to generate the unique document number based on the request that has been processed , And you can able to decide whether you need to create a new document no or you need to use the existing document no based on the business process you need to perform.

Openbravo function is :

ad_sequence_doc("Sequence Name","client Id","Update next sequence or not").

For Example :

select ad_sequence_doc("Document_for_Order","ad_client_id","Y") 

Y for generating the new Sequence Number , N for retain the previous sequence number.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top