$q=$this->_em->createQuery('SELECT t FROM Doctrine\Tests\ORM\Functional\Locking\OptimisticTimestamp t WHERE t.name = :name');
$q->setParameter('name','Testing');
$test=$q->getSingleResult();
// Manually increment the version datetime column
$this->_conn->execute('UPDATE optimistic_timestamp SET version = ? WHERE id = ?',array(date('Y-m-d H:i:s',strtotime($test->version->format('Y-m-d H:i:s'))+3600),$test->id));
// Try and update the record and it should throw an exception