Replies: 5 comments
-
@deepakprabhakara Is there some other global state that jackson is holding onto between constructing the controllers? I'm calling |
Beta Was this translation helpful? Give feedback.
-
@sbking I will check but can't think of anything else immediately. It could be possible the db driver itself might be caching something, which db are you using? |
Beta Was this translation helpful? Give feedback.
-
Hi @deepakprabhakara , ultimately I think what was happening is that the health check happens in the background, and there's no way for me to initialize the controllers AND wait for them to be ready. The health check happens at some point, but I can't await a promise to know when it's happened. So when it does eventually happen, the database client may or may not already be closed. What that resulted in is every other request fails. I ended up deciding to go with openid-client and samlify instead of boxy, so that I could have more control over my database, database connections, migrations, and avoid issues like this which I can't control. |
Beta Was this translation helpful? Give feedback.
-
@sbking Sorry we were unable to get to resolving this any sooner and I totally understand your decision. Serverless is certainly a tricky one for us and your investigation is very helpful to us to try and resolve this. |
Beta Was this translation helpful? Give feedback.
-
Is there any way to disable caching the database object (i.e., pass
noCache: true
to this function when creating controllers)?Context - I'm using a serverless environment where I create and tear down a database connection (proxied) for each request. However since Jackson keeps the database object in the global scope, on the second request it tries to reuse a closed database client and fails.
Currently I'm working around this by manually setting
global.__jacksonDb = undefined;
at the end of my request handler.Beta Was this translation helpful? Give feedback.
All reactions