I have a python script which is querying an sql-database. it does some stuff with the query, then puts a timestamp on the sql-database, so it only has to query the stuff that's happened after that timestamp.
The process takes a few minutes, so putting the timestamp at the end of the process means it might miss stuff that happened after the select query, but before it'd finished doing stuff.
I tried beginning a transaction, making a timestamp, doing the query, then committing the transaction, but it wouldn't give me the results of the select query until after i'd committed (defeating the whole point).
What is a good way of doing this?