Suggestion about tracking orders in SQL

You may find this helpful: A guide to understanding 'Persistent Context'