As there is an initialize
function, is there an exit
/on_exit
function such as I can close my database connection into it?
I would suggest to handle this at the request level to be fully portable among various EiffelWeb connectors. Now, could you tell us which solution you are using ? EiffelWeb standalone connector, or rather libfcgi with apache for instance? or else?
For standalone, you can redefine the "launch" procedure, in order to perform cleanup task when you exit the application (which is also the server).
For libfcgi, the C API may provide such facility, but so far, the Eiffel libfcgi library does not wrap it. If needed this may be possible to implement it.
-
Thx, I'm using the standalone for the moment, but I think the question is beyond the connector, what is the mecanism which as you said well permits me to handle @ request level a database resource. I think it should have a connector independent answer to that question. Is it the launch procedure? – Pipo Oct 12 '18 at 16:51
-
1Honestly, I need to check the libfcgi implementation to see how the FCGI server is terminating. For standalone, yes, you can redefine the launch, to have post execution operations. I guess we need to provide this with a "on_exit" procedure, so app could hook cleanup operation. – Jocelyn Oct 16 '18 at 7:32
-
Doesn't it make sense to redefine the
clean
procedure of WSF_FILTERED_ROUTED_EXECUTION inherited into the classical EWF_APP_EXECUTION to close the connection? and connect into theinitialize
?? – Pipo Oct 17 '18 at 14:01 -
-
what would you advise? the alternative would be to connect-disonnect on service launch and exit which would have a pending connection all the time... timeout managment etc... – Pipo Oct 18 '18 at 14:33
Called in each request which is probably not the best solution but I have chosen following way for the moment:
Redefine the clean
procedure of WSF_FILTERED_ROUTED_EXECUTION inherited into the classical EWF_APP_EXECUTION to close the connection
Connect into the redefined initialize