Call to a member function beginTransaction() on null


#1

Hi,

I am having some trouble deploying a custom API based on a PHP script: the script works once, then on subsequent calls fails with an exception, until I clear the Dreamfactory cache.

The script with problems:

  1. Receives a JSON document that refers to several different related tables, in a custom format
  2. Parses this JSON to extract the data that we need
  3. Generates a resource to submit through an internal API call to Dreamfactory, including related data - using the XX_by_XXID notation as per the documentation: Related Data
  4. Submits the resource in a transaction, i.e. with rollback=true

So far I have tried:

  • Using my script to generate the resource and submitting this manually through the API docs - this works
  • Reinstalling Dreamfactory - this seemed to work, but I came in the next day and the issue was back
  • Changing from MariaDB to MySQL-5.7 - this made no difference

When I check the MySQL logs, I am seeing no second attempt to submit the request (which would make sense, given that the error implies that the connection has gone away).

I am running out of ideas, has anyone else come across this issue?

Many thanks,

Ollie


#2

Hi everyone,

I have found a solution (or perhaps just a workaround) to this. See https://github.com/laravel/framework/pull/22905

Hope this helps someone.

Ollie