IDEMPIERE-1044 Load testing. Modify to generate uuid sequence by idspace instead of by desktop to reduce the possibilities of uuid change on subsequent run.
This commit is contained in:
parent
189ef8425d
commit
d4f2d337cc
|
@ -88,13 +88,14 @@ public class AdempiereIdGenerator implements IdGenerator {
|
|||
}
|
||||
|
||||
String number;
|
||||
if ((number = (String)desktop.getAttribute("Id_Num")) == null) {
|
||||
IdSpace idspace = comp.getSpaceOwner();
|
||||
if ((number = (String)idspace.getAttribute("uid.sequence")) == null) {
|
||||
number = "0";
|
||||
desktop.setAttribute("Id_Num", number);
|
||||
idspace.setAttribute("uid.sequence", number);
|
||||
}
|
||||
int i = Integer.parseInt(number);
|
||||
i++;// Start from 1
|
||||
desktop.setAttribute("Id_Num", String.valueOf(i));
|
||||
idspace.setAttribute("uid.sequence", String.valueOf(i));
|
||||
|
||||
return uuid + "_" + i;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue