Customers could switch service provider easily because of lower searching cost and identical service in online environment. Most marketing research for customer loyalty emphasizes the effect of satisfaction and switching barrier, derived from investment model. However, how satisfaction and switching barrier influence customer loyalty has been less conclusive. The possible reason is neglect of commitment. We inject the concept of commitment in relationship marketing, which consists of affective and continuous commitment, into investment model for enhancing mediating role of commitment. Empirical results gathered from online survey in virtual financial communities show that commitment is the essential mediator in cultivating customer loyalty. Besides, satisfaction and switching barrier influence loyalty by different component of commitment, affective continuous commitment respectively. Affective commitment is more important than continuous commitment. E-brokerage should pay attention to earning customers' commitment for retaining customers.