kafoso / doctrine-firebird-driver

Firebird driver for the Doctrine DBAL/ORM
MIT License
14 stars 16 forks source link

Error in transactions (update, insert) #7

Closed selectmatica closed 5 years ago

selectmatica commented 5 years ago

Hi, I have installed your package in symfony 3.4 and for the queries it works perfectly, but when you try to perform an update or an insert, when you perform the transaction an error occurs and it is disconnected.firebird 2.5.2 PHP 7.3 4  "phpunit / phpunit": "^ 8.2",  "doctrine / orm": "^ 2.6", "doctrine / dbal": "2.6. *", The error that appears from postman is: Could not get any response There was an error connecting to http: //localhost/miweb/rest/web/app_dev.php/pedido/new.

Could you suggest a solution? Thank you.

kafoso commented 5 years ago

I haven't encountered (non-user level) problems with insert/update and transactions as of yet. There are integration tests, which cover transaction specifically: https://github.com/kafoso/doctrine-firebird-driver/blob/2.6.2/tests/tests/Test/Integration/Doctrine/DBAL/Database/TransactionTest.php

However, only INSERT and SELECT were covered in these tests. Not UPDATE.

I have just completed the following steps in 2.6.2:

$ vagrant destroy
$ vagrant up
$ vagrant ssh
vagrant@ubuntu-xenial:~$ sudo su
root@ubuntu-xenial:/home/vagrant# apt-get -y install firebird2.5-superclassic
root@ubuntu-xenial:/home/vagrant# dpkg-reconfigure firebird2.5-superclassic
root@ubuntu-xenial:~# apt-get install zip -y
root@ubuntu-xenial:~# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
root@ubuntu-xenial:~# php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer co rrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
root@ubuntu-xenial:~# php composer-setup.php
root@ubuntu-xenial:~# php -r "unlink('composer-setup.php');"
root@ubuntu-xenial:~# mv composer.phar /usr/bin/composer
root@ubuntu-xenial:~# cd /var/git/kafoso/doctrine-firebird-driver
root@ubuntu-xenial:/var/git/kafoso/doctrine-firebird-driver# composer install
root@ubuntu-xenial:/var/git/kafoso/doctrine-firebird-driver# cd /var/git/kafoso/doctrine-firebird-driver/tests
root@ubuntu-xenial:/var/git/kafoso/doctrine-firebird-driver/tests# ../bin/phpunit tests/

I have updated tests/tests/Test/Integration/Doctrine/DBAL/Database/TransactionTest.php (see 7946127bf6bcd9a5ca92a23197a925a9d16a438a) and it is now covering UPDATE tests as well.

All tests pass and perform as expected.


Which version of kafoso/doctrine-firebird-driver are you using? 2.6.2?

It would seem the problem is not related to this driver. Perhaps a network problem?

selectmatica commented 5 years ago

Hi, I've done the tests and this is the result: error_kafoso error_kafoso2

I have updated the indicated file according to the link. "doctrine/dbal": "2.6.*", "kafoso/doctrine-firebird-driver": "^2.6.2", By the way, I'm using windows 10 64 pro.

kafoso commented 5 years ago

As stated in the README.md file:

The problem you are encountering above is that you are running it on Windows. \Kafoso\DoctrineFirebirdDriver\Test\Integration\AbstractIntegrationTest::DEFAULT_DATABASE_FILE_PATH has a hardcoded path of /var/lib/firebird/2.5/data/music_library.fdb, meant for the guest OS (Ubuntu). Therefore the file is not found (path is invalid on Windows), chmod(...) fails, and that is the reason for the test failures.

To successfully run the integration tests, you must either:

kafoso commented 5 years ago

@selectmatica

If you have no further inquiries I will close this issue. I do not think the issue, you are facing, is related to this library. At least not separately.

selectmatica commented 4 years ago

Dear sir, first of all apologize for the delay and just say that after some tests, the error was not such an error but a poor understanding of the problem-solution on my part. Your pack is great and has helped me a lot in the development of several applications. Of course, closed issue and mencioinado problem did not exist. Thank you so much.