Update client.py

Use global tx in query cause following command such as relations.all() fail.