Hi,
I am trying to implement some additional validations for one of my entities. I registered the following code:
this.before('UPDATE', 'Activities', async req => {
const db = cds.connect.to('db');
const service = new ActivityService(db);
ErrorProcessor.processMsgs(req, await service.updateCommand(req.data));
});
In side of that method updateCommand, I need to retrieve some records from DB. E.g. something like this:
const { Activities } = this._db.entities;
const result = await
this._db.read(Activities).where({ID:ID});
When I try to perform any query, I am getting the following error:
Requesting client from pool timed out. Max pool size is 1, current pool size is 1. Increase "acquireTimeoutMillis" for longer waiting time or "max" to create more clients.
It seems like it fails to get a client connection to SQLite DB. Why is this happening? What am I doing wrong that I cannot perform additional request to sqlite DB? Surely, this should be possible. I am doing something similar for CREATE operation and there is no issue.