Postgres Edit Connection persistent

Hello,

I’m trying to fill my grids through postgres connection.
I’m Creating the connection normally (host, post, credentials etc), i load my grids , my data , my forms and everything works fine.

But i’m having a problem with the Persistent Connection option.

I have Persistent Connection set to ‘No’ because i want the connection to be killed after every script, quit etc, but my connections still persist as many times as i load the same grids, and even new ones are created for the same grid. So it continuously fills my connection table with new ones, for the same grid or form etc resulting in heavy load and connection limit problems.

Any suggestions? Is this a server option that i should take care off, or am i using something wrong with scriptcase database connections ?

ScriptCase Version: 9.0.010
Database Server: “PostgreSQL 9.4.5 on x86_64-slackware-linux-gnu, compiled by gcc (GCC) 4.8.2, 64-bit”

Thanks in advance!

I wondered about this too. From observation, it appears that SC holds the database connection open using a timer. Close the browser tab with that grid app, and “soon-ish”, the connection will close.

That looks like a timer to me, but I haven’t looked at the connection management code. It’s complex and the variables/class names are in Portugese. You have the code though, and if you’re really determined, you can figure out what it does and possibly even why.

Off the top of my head, I’d guess it’s because SC has to physically interrogate the database for every page load of the grid (yes, has to: think tables with 300 million records, each record averages 10 MiB). Plus, establishing a connection to the database is very expensive / slow. If I’m right about the timer, then SC made a trade-off to boost performance. You might have to re-write the connection code to get exactly what you need.

All that aside, SC apps are not well-suited for the 10 million concurrent users scenario (it could be done), and I’d guess that you’re more likely to run out of RAM before you run out of database connections (unless you’re running your postgresql server remotely on Windows 7 Home Edition ;o).