Hopefully, quick questions for the experts :): 1. ...
# lucee
c
Hopefully, quick questions for the experts :): 1. should hibernate and queryexecute connections automatically be closed when used inside runAsync? 2. Same question for use of cfthread. Asking because seems as if database connections / connection pools are being left open / abandoned resulting in “max connections reached, additional reserved for super user” errors since upgrading from lucee 5 to lucee 6 (all stable + RC) and change of one cfthread to runAsync equivalent.
z
cfquery borrows and returns from the pool each time it's used, queryExecute is just a cfml wrapper around cfquery
if you use this, you can see each borrow being logged to the console (connection activate / validate ) for each query https://luceeserver.atlassian.net/browse/LDEV-3420
c
If used in runAsync for a very long running query , any chance the connection wouldn’t get released back? Eg if request timeout is less than length of query
z
possibly....
z
can you post about this runAsync problem to the mailing list please? slack is sadly a black hole
c
Will do. Did some more debugging. Seems related to entityload (or ormexecutequery) in a thread that’s called by ORM event handler. The result set is a collection of empty structs and , although no error is thrown, seems as if the connection isn’t released when the thread finishes
z
Which Orm Extension are you using?
c
Hibernate ORM 3.5.5.89
z
Have you tried the Ortus ext? It's had a lot of updates
c
Briefly but I guess I didn’t set it up correctly because got a “no ORM extension” found.
In any case I prob will have to revert to lucee 5.4.x , seems like other issues too, like it wanting to save strings like “51-1” as timestamps even though ORM properties says ormtype =“string”
So end up with stuff like this 😥
z
Oh that's a strange bug, with 6.2 and 3.5.5?
c
6.2 for sure. Got ortus ORM working and same thing happens (both with regard to abandoned connections as well as the /string as timestamp issue)
z
please file a bug! would you be able to adapt one of this existing test to repo the issue and file a PR? here's a good template testcase https://github.com/lucee/Lucee/blob/6.2/test/tickets/LDEV4461.cfc https://github.com/lucee/Lucee/tree/6.2/test/tickets/LDEV4461
c
I’ll try to set up test case next few days when I have some free time
👍 1
I did a deep dive and Seems as if issue with our code. Apparently, isValid (‘date’, ‘51-1’) evaluates to true :) and our new ORM basemodel converts it to date/timestamp . Since the DB column type is string , it stores the string representation of the timestamp
z
thanks for getting back to me on this