OPENJPA-2449: refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock - applied to trunk Albert Lee's patch.