I am using CakePHP 1.3 with MySQL and run in a tight loop with code like:

```
if ($this->Model->find('count', array('conditions' => array('Model.name' => 'name'))) == 0)
{
    $this->Model->create();
    $this->Model->save(array('Model' => array('name' => 'name')));
}

$data = $this->Model->find('first', array('conditions' => array('Model.name' => 'name')));

```

However, at times $data comes out to be NULL; in other words, the record doesn't exist even though I do create/save a new record if it doesn't exist to begin with.

Is there some delay between the time the record gets created and when it is available?

Any help is greatly appreciated.

**EDIT 1** I should point out that I do make sure the call to Model->save() succeeds before continue. 

```
if (!$this->Model->save(array('Model' => array('name' => 'name'))))
    $this->error('Save failed');

```

Thank you.