0
我有下面的方法來創建transactioID,我不知道它是否創建相同的ID,而多線程執行 我可以遇到什麼樣的問題的方法?TransactionID創建
private String getTransactionId(){
StringBuffer buf = new StringBuffer("");
buf.append(this.getPrefix());
buf.append(this.getApplicationId());
buf.append(this.getThreadId());
buf.append(System.currentTimeMillis());
try{
Thread.sleep(1);
}
catch(Exception e){
}
while(buf.length()<19){
buf.append("0");
}
return buf.toString();
}
你是對的,至少this.getThreadId()paremters使交易ID唯一,即使其他所有交易都是相同的。 – 2014-09-03 20:47:52