Relationship query sql 1040 error


I’m using on an azure deployed image.

Admin Application Version: 2.1.5

DreamFactory Version: 2.1.1

I have a table which has few hundred entries. Each entry has a user_id colum.
Relationship of the table :
user_profile_by_user_id belongs_to user_profile user_id true

When I query related data for each of the hundreds of entries based on each user_id

$GetParameters = [‘filter’ => (‘user_id=’.$userID),
‘related’ => (’*’),

If I include all the related data in the query I get SQLSTATE 1040 too many connections. It only happens when the query has few hundred results. If there’s less data all is fetched fine.
Is there some limit I can increase so I bypass this error putting the burden on the server temporarily ?

Thank you.


The type of limit you’re looking for would be set on the sql server (number of connections allowed.)
Unfortunately, the way that DreamFactory is currently architected, each relationship for each record is a separate database transaction, and connection are not necessarily reused. This would definitely cause an issue with number of connections on that much data at one time. In newer versions of DreamFactory there has been some work done on reusing connections, though I can’t recall at the moment exactly which version.
Finally, it should be noted that in an upcoming sprint (likely the next one, probably not time in the current one) we will be working to make these related data calls more efficient, which will reduce the number of transactions and therefore number of connections needed.