select call to db reads old values

2010-03-08
2012-09-19
  • Karthik Srinivasan

    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)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks