Class DefaultUpdateComparator<I>

  • Type Parameters:
    I -
    All Implemented Interfaces:
    Comparator<com.broadleafcommerce.data.tracking.core.service.Update<I>>

    public class DefaultUpdateComparator<I>
    extends Object
    implements Comparator<com.broadleafcommerce.data.tracking.core.service.Update<I>>
    Provides a comparator to order update items by their ID to avoid deadlocks in RDBMS systems where multiple updates occur with pessimistic locking inside a single transaction.
    Author:
    Kelly Tisdell (ktisdell)
    • Constructor Detail

      • DefaultUpdateComparator

        public DefaultUpdateComparator()
    • Method Detail

      • compare

        public int compare​(com.broadleafcommerce.data.tracking.core.service.Update<I> o1,
                           com.broadleafcommerce.data.tracking.core.service.Update<I> o2)
        Specified by:
        compare in interface Comparator<I>