I do not believe your processing program can determine if a record is committed. This is a system function. The records will not commit until you issue the commit command, so you would need to keep track of the records in your code.
SO this program locked the records .. perhaps changing the records and you want a way to know if they are not yet committed. I think you will have to keep an array of Uncommitted keys and check the records you are reading against the array.
How about changing PGMA
seems way to simple.