Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

select call to db reads old values

2010-03-08
2012-09-19
  • 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.

     
  • Andy Dustman
    Andy Dustman
    2010-03-08

    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)