I have a class which manages all db APIs like select, delete, update, insert
etc., I have a table in Mysql DB which has a flag variable that will get set
from an external script. The application will keep polling for this variable
and when this variable is set., it will take appropriate actions.
Unfortunately, the application always reads the old value from the database
table unless the object of the class is reinstantiated for every polling.
Kindly let me know what is the best way to achieve this without repeated
instantiation of the class object.
Thanks in Advance.
karthik.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a class which manages all db APIs like select, delete, update, insert
etc., I have a table in Mysql DB which has a flag variable that will get set
from an external script. The application will keep polling for this variable
and when this variable is set., it will take appropriate actions.
Unfortunately, the application always reads the old value from the database
table unless the object of the class is reinstantiated for every polling.
Kindly let me know what is the best way to achieve this without repeated
instantiation of the class object.
Thanks in Advance.
karthik.
Try doing a commit or rollback after each poll; this is normal transactional
behavior.
[http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html
isolevel_repeatable-read](http://dev.mysql.com/doc/refman/5.0/en/set-
transaction.html%23isolevel_repeatable-read)