im having a problem while inserting new record to the database in Symfony 4 using doctrine/oracle/oci8 driver. My entity configration with sequence id generation:
<id name="id" type="integer" column="ID">
<generator strategy="SEQUENCE"/>
<sequence-generator sequence-name="FILES_SEQ" allocation-size="10" initial-value="1"/>
</id>
That's how I insert new record to the database:
$file = new File();
$file->setFileName($fileParams['fileName']);
...
$this->getEntityManager()->persist($file);
$this->getEntityManager()->flush();
Record is persisted successfully, but the problem is when I try to get last insert ID by:
$file->getId();
then the ID returned is 1 less then one in the database. Is this some kind of caching problem?? I tried using getEntityManager()->refresh($file) but it doesn't work. Also when I'm invoking findAll() method, the value of ID is correct there.