Not sure I understand your question, but are you saying that your database contains more tasks then you would be expecting? In this case, it contains tasks that we're created in a previous session but which are still there, even though you terminated the session (which seems to make sense to me, as terminating a session / process does not remove the tasks)?
Could you maybe share your process and a simple test case that shows this behavior so I can reproduce?
Kris