Başar Aykut
added a comment - 07/Dec/10 8:55 AM I have updated to the latest version in the git. Below query works and returns the updated object as expected. However this is true only for the first call. Repeated calls return the first object .
$pid = $dm->createQueryBuilder('downloads')
->findAndUpdate()
->returnNew( true )
->field('key')->equals('file1')
->field('counter')->inc(1)
->getQuery()->execute();

Since Doctrine maintains an identity map, the 2nd time it is not refreshing the documents data. Since it already exists in the identity map it simply returns that document. You can tell Doctrine to refresh the data by doing this:

Başar Aykut
added a comment - 09/Dec/10 10:28 AM I don't see any function called refresh? Are you going to add it? I think it would be better to return refreshed data automatically for the findAndUpdate command.