Promoting customer loyalty is a primary concern for e-brokers since customers in an online environment can easily switch from one service provider to another because of the ease in finding an alternative service. Most prior researches on customer loyalty emphasize the effect of satisfied service quality and switching barriers. However, how satisfaction and switching barriers influence customer loyalty has been less than conclusive. We explored the relationship of service quality, switching barriers and customer loyalty based on an enhanced investment model, which includes the concept of commitment in relationship marketing. Empirical results gathered from an online survey in online financial communities show that commitment is an essential mediator in cultivating customer loyalty. Service quality and switching barriers influence loyalty by different components of commitments - affective and continuance commitments, respectively. Moreover, affective commitment is found to be more important than continuance commitment. As a result, e-brokers should pay more attention to earning customers' commitment, so as to retain their business.