More database woes with newest Lucee versions

Using PostgreSQL 9.3.6 with Lucee (as well as RC and the latest snapshot), I get the following error after a day or two of usage:

FATAL: remaining connection slots are reserved for non-replication superuser connections

I downgraded Postgresql JDBC driver from v9.4.1212 to v8.3.0.jdbc4 and it error seemed to go away.

Anyone else encountering such errors?

I’m using Postgres 10 on Windows with no issues, driver version 9.4.1212

Can you tell us more about your setup?

What would you like to know? :slight_smile:
Using a combination of SQL statements, ORM, and threads for database processing. Haven’t made any code changes recently - only thing was upgrading the version of Lucee.

If you enable Debug Output with the Modern debug template, it shows the number of open connections and max open connections.

What do those show?

Continuing to have problems, even with the above versions of lucee and jdbc driver.

This time it says anywhere from 0-4 slots open. Last week it had gotten up to 112 connections. Could this be due to an ORM problem? Are there any additional logs to look at (besides the Lucee logs which don’t seem to have any info besides the above error in them…)

Are you by any chance calling OrmReload() at any point? If so this might be relevant:

Having said that, this issue goes back to Railo, and you imply it was working OK in a previous version of Lucee so perhaps not the cause.

Which version of Lucee did you upgrade from?

No, do not use ormReload().

Unfortunately, I can’t remember which specific version I upgraded from. It might have been

The only relatively recent change has been moving server code to one additional server. So, one server processes interface stuff and the other server handles REST requests. However, both Lucee servers have low max connections, which should make the total # of connections still under the database’s max.

Any chance this is related to: (but this was fixed in latest snapshots???)

So I think I isolated the issue to one server causing the bottleneck.

The only difference I found between the two servers was that “Flush at request end” was checked off on the malfunctioning server. I have turned it off now (to match what I think is the functioning server) and will see if this solves the problem.

If it solves the problem, I guess I should file a bug report?

So clearly, there is an issue with newer versions of Lucee and Database driver. This includes the newest RC and snapshots after RC.

If I upgrade to these versions, after a few days, I get the “FATAL: remaining connection slots are reserved for non-replication superuser connections” error, with either the Postgresql JDBC driver from v9.4.1212 to v8.3.0.jdbc4 drivers (though with v8.3.0, I believe I get Lucee crash with GC overhead limit reached rather than connection error).

With the currently released version of Lucee (v5.2.4.37), I sometimes get a “lucee.runtime.exp.DatabaseException: FATAL: sorry, too many clients already” error message but this usually auto-resolves after a bit of time (ie., I dont have to restart Lucee).

I do use Hibernate / ORM in threads with two servers running the app, accessing the same database. Can someone provide some insight on what could be going wrong and/or how to debug this major issue?