Skip to content

Symfony 4. Problem with cache and source file editing. #24

@klimick

Description

@klimick

Hello! I have problems with editing source files. Aspects stop working after any change in the source file that works under the aspect. After running the cache:clear command, all aspects continue to work until a new change is made to the source file.
I'm using symfony 4.0.5 with autowiring.

The aspects that I use:

/**
     * @Before("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function beginTransaction()
    {
        $this->entityManager->getConnection()->beginTransaction();
        $this->entityManager->getConnection()->setAutoCommit(false);
    }

    /**
     * @After("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function commitTransaction()
    {
        $this->entityManager->flush();
        $this->entityManager->getConnection()->commit();
    }

    /**
     * @AfterThrowing("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function rollbackTransaction()
    {
        if ($this->entityManager->getConnection()->isTransactionActive()) {
            $this->entityManager->rollback();
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions