clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

Not working with doctrine/dbal 3.3

Open N-M opened this issue 3 years ago • 5 comments

After the upgrade from doctrine/dbal 2 to 3.3 Clockwork stopped working. Removal of code below shows performance tab only.

 /** @var \Clockwork\Clockwork $clock */
$clock = $container->get('clockwork');
$clock->addDataSource(new DoctrineDataSource($entityManager));

image

N-M avatar Jul 04 '22 10:07 N-M

Hey, can you please provide more information about your app? From the code example it doesn't seem like a standard Laravel app.

itsgoingd avatar Jul 06 '22 19:07 itsgoingd

It is the Slim app with Clockwork middleware.

I have made a test repo. This is a working example with dbal2 https://github.com/N-M/Slim-Skeleton image

An example with dbal3 that is not working can be found here https://github.com/N-M/Slim-Skeleton/tree/dbal3 image

If I comment out code below test app will work but without Database tab in Chrome plugin

/** @var \Clockwork\Clockwork $clock */
$clock = $c->get('clockwork');
$clock->addDataSource(new DoctrineDataSource($entityManager));

Please let me know if you need more details

N-M avatar Jul 06 '22 21:07 N-M

Thanks, this is very useful, will return to this tomorrow.

itsgoingd avatar Jul 06 '22 22:07 itsgoingd

Hey, I've finally got around to check this out. This should now be fixed in master and will be released soon, sorry for the long wait.

This was actually caused by resolving of the connection name for executed queries. In DBAL 2 this was implemented by looking at the configuration, this implementation changed in DBAL 3 to execute an actual query, thus leading to infinite recursion.

I've fixed this by resolving the connection name only once, early in the process, instead on every collected query.

itsgoingd avatar Aug 04 '22 22:08 itsgoingd

Thank you @itsgoingd for resolving the issue. We are very happy with the tool.

N-M avatar Aug 05 '22 18:08 N-M

Glad you like it, this is now released as part of Clockwork 5.1.7.

itsgoingd avatar Aug 14 '22 21:08 itsgoingd