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:
Heng Sin Low 2013-07-09 00:06:53 +08:00
parent 189ef8425d
commit d4f2d337cc
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}