David E Jones wrote: > On Dec 7, 2009, at 1:37 PM, Adam Heath wrote: > >> David E Jones wrote: >>> Just a quick thing I noticed while looking at this again: this won't >>> prevent conflicts in multi-server deployments. >>> >>> -David >> This patch is completely, 100% wrong, and won't fix the problem. >> >> >> install ofbiz, install demo data, run it. >> >> /usr/sbin/ab -c30 -t 50 http://localhost:8080/webtools/control/main >> >> It has absolutely nothing to do with any database, nothing to do with >> synchronization. The faster your computer that is running ofbiz, the >> faster it can respond to requests, and the easier it becomes to hit >> this bug. > > You're right. Just because it's synchronized doesn't mean that you won't get > multiple calls within a millisecond. > > I guess we have two options: > > 1. query to check for a conflict and add 1ms if there is a conflict
This still won't fix it, for the exact same reason. There are even more requests coming in, for the next millisecond. The fix here is have something else completely be the key, or have something more be part of the key. > 2. change the entity to use a sequenced ID as the pk instead of the timestamp With possibly a larger allocation window.
