Animation Involving Swapping Hand Holding Weapon

I am wondering how to properly set up an animation which involves the hand that is holding the weapon swap example. The main issue I am struggling with is how to dynamically change the attachment of the weapon the way that nothing looks odd. I assume the rotation and location of the socket attached to the left hand would need to dynamically adjust to match the movement of the weapon. Do you know any solutions to this problem?

bump, any ideas?