laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

DBAL exception on getDoctrineSchemaManager()

Open mdemori opened this issue 4 years ago • 3 comments

I'm using https://github.com/TheDoctor0/laravel-factory-generator for Factory creation, but seem that is not compatible with laravel-oci8, when i run the command for creating the factory I receive below error:

Argument 1 passed to Doctrine\DBAL\Connection::ensureForwardCompatibilityStatement() must be an instance of Doctrine\DBAL\Driver\ResultStatement

seem that this command use the getDoctrineSchemaManager() that is not compatible with laravel-oci8.

I'm not 100% sure that is the same problem, but I've similar problem with ide-helper that I can't use anymore for the same error, in this case I don't Dig around to understand the problem, but seem the same error.

With Mysql/MariaDb both applications works as expected.

System details

Laravel 7.30.4 PHP 7.4 Oracle 19 Linux Centos 8.x Laravel-OCI8 7.1.1

mdemori avatar Aug 09 '21 13:08 mdemori

I think this is related to the breaking change of PHP on PDO class. Will try to revisit the latest implementation when I got the chance. Thanks for reporting.

yajra avatar Sep 18 '21 02:09 yajra

I tryed to check if I can find a way to solve this problem but the solution is probably too far from my capabilities.

I'd been able to pinpoint where the problem reside:

  • DBAL, inside the method executeQuery() on lib/Doctrine/DBAL/Connection.php call the query() method on laravel-oci instance connection.
  • This fire the query() method inside src/Pdo/Oci8.php
  • query() method call the prepare() method inside the same class, this method finally instantiate a new statement class from src/Pdo/Oci8/Statement.php

this result is passed to ensureForwardCompatibilityStatement() method on lib/Doctrine/DBAL/Connection.php and here... everything explode :D :D

so, the problem is that in some way the Statement class of laravel-oci must return an Doctrine\DBAL\Driver\ResultStatement instead an instance of Yajra\Pdo\Oci8\Statement

could you pointing me in the right direction for solve this problem? i really don't have any idea... on how to handle this problem by myself sorry :(

mdemori avatar Jan 27 '22 15:01 mdemori

@mdemori what version of DBAL are you using and still on Laravel 7? Also, can you please provide some snippets to replicate the issue?

For some issues, it seems like installing dbal:3.x solves the issue but I think it's for Laravel 8.

yajra avatar Feb 02 '22 12:02 yajra

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 10 '22 04:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 17 '22 04:10 github-actions[bot]