Hello Everyone,

    I'm facing a very strange problem with find query. In a function
I'm calling find query(assume query as A) initially on a condition,
this fetches that data accurately and I'm updating that record and
saving it. It gets saved properly. After saving it, in the very same
function in a different line I use the query A again on the same
record. This time I get the old data that was not updated. But I need
the updated data.

The following debug lines may help out to understand the problem, in
depth :

Initial find condition :

$assignergrpd=$this->ThreesixtydegreeScheduleCounter-
>find('first',array('conditions'=>array('AND'=>array('ThreesixtydegreeScheduleCounter.tech_id'=>
$tt2['TeamTechmapping']
['tech_id'],'ThreesixtydegreeScheduleCounter.threesixtydegree_test_id'=>
$threesixtydegreeTests['ThreesixtydegreeTest']['id']))));
debug($assignergrpd);

gives the following debug output :

Array
(
    [ThreesixtydegreeScheduleCounter] => Array
        (
            [id] => 7
            [tech_id] => CTS0082
            [no_reviews_assigned] => 0
            [no_reviews_recieved] => 0
            [tech_level] => Level3
            [team_id] => 105
            [threesixtydegree_test_id] => 1
        )

)

This output is accurate.

app/controllers/threesixtydegree_schedules_controller.php (line 6503)

Array
(
    [ThreesixtydegreeScheduleCounter] => Array
        (
            [id] => 7
            [tech_id] => CTS0082
            [no_reviews_assigned] => 4
            [no_reviews_recieved] => 5
            [tech_level] => Level3
            [team_id] => 105
        )

)
The above debug is of the data that is getting saved.

The data below is retreived after saving  the above data and the below
debug line is inside if($save data of line6503). Since it's entering
the
loop we can understand it's getting saved and retreived only after
that.

Same initial condition called again :

$assignergrpd123=$this->ThreesixtydegreeScheduleCounter-
>find('first',array('conditions'=>array('AND'=>array('ThreesixtydegreeScheduleCounter.tech_id'=>
$tt2['TeamTechmapping']
['tech_id'],'ThreesixtydegreeScheduleCounter.threesixtydegree_test_id'=>
$threesixtydegreeTests['ThreesixtydegreeTest']['id']))));
debug($assignergrpd123);

gives the follwing debug output :

app/controllers/threesixtydegree_schedules_controller.php (line 6508)

Array
(
    [ThreesixtydegreeScheduleCounter] => Array
        (
            [id] => 7
            [tech_id] => CTS0082
            [no_reviews_assigned] => 0
            [no_reviews_recieved] => 0
            [tech_level] => Level3
            [team_id] => 105
            [threesixtydegree_test_id] => 1
        )

)

This output is not accurate and is giving the old data. It has to
fetch the updated data.


Can any one please help me out. Advance thanks to all the suggestions.

Thank You,
Guru Prasad

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to