I would like to implement something similar to shopping cart functionality when user performs some actions, data entry across multiple screens etc and its persisted only if user clicks "save" when viewing his "shopping cart" content (all data he has entered across multiple screens). I would be keeping all such data in some staging table first as its entered (with userid + sessoid key) but I want to know how and when to cleanup staging table rows that were not acted on (and permanently saved in non-staging tables) by user during session when they were created and which of the staging rows to save (only the ones created during current session).
I hope its not a very complicated explanation and it makes sense.
This is essentially a "shopping cart"-like functionality.