[ 
https://issues.apache.org/jira/browse/OFBIZ-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117950#comment-14117950
 ] 

Jacopo Cappellato commented on OFBIZ-2353:
------------------------------------------

[[email protected]] wrote:
{quote}I know you have faith that nothing will go wrong [...]{quote}

this doesn't sound very respectful of my time, work and opinions.
this is too much... I have patiently used a lot of my time to study the code, 
provide unit tests to prove my assertions (no one did it before in this 
ticket), discuss with Jacques and reply to his objections and finally fix the 
code.
But after that it was not enough (even if now the code works fine) and I had to 
answer to Jacques' questions, review and test your code snippets (the first is 
clearly wrong, even if you said it wasn't, the second had serious performance 
issues) then read Jacques' comments on his personal preferences... and after 
all this time spent you treat me like I am the dumb one.

If you think that my code is not considering some corner cases you should 
better spend your time helping to spot them and fix them without changing the 
algorithm (that despite what you are saying is extremely simple, efficient and 
is implemented with about 10 lines of code), rather than trying to demonstrate 
that you can produce an equivalent one (which looks better to you and Jacques).

You are using my time trying to prove you are right and I am wrong and with all 
the stuff we have to do in OFBiz, now that this code is performing well and 
works under heavy load, we could move one and work on something else.

Your third approach now is faster than your version 2 because it uses a 
preparedstatement (which is something I mentioned to you in chat as a possible 
improvement in general): but still, just to get the same performance, it uses 
more database resources (more db hits), also it is bad practice to not close a 
prepared statement.
I am not saying that your algorithm is bad or worse: they are similar 
(approximately same number of lines, similar performance) and there are some 
differences and at this point is a matter of personal preference.
I really want to move to something else now.

> SequenceUtil  may generate duplicate IDs in Load Balancing mode
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-2353
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2353
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 4.0, Release Branch 09.04, Trunk
>            Reporter: Philippe Mouawad
>            Assignee: Jacopo Cappellato
>            Priority: Critical
>             Fix For: Release Branch 10.04, Upcoming Branch
>
>         Attachments: OFBIZ-2353 SELECT FOR UPDATE solution.patch, OFBIZ-2353 
> SELECT FOR UPDATE solution.patch, OFBIZ-2353-AC.patch, OFBIZ-2353-AC.patch
>
>
> If Ofbiz is deploy on 2 servers in Load Balancing Mode
> SequenceUtil will generate duplicate IDs because synchronization is done at 
> JVM level instead of doing it in DB.
> A good replacement implementation would be:
> org.hibernate.id.enhanced.TableGenerator
> But it would involve a dependency on Hibernate
> Philippe
> www.ubik-ingenierie.com



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to