Lambda queries do not reflect the database state

0

Hi,

I have a lambda that connects to an Amazon Aurora RDS instance and gets data from it. In the database, I have two tables, Student and Processed. My lambda query returns 5 students from the student table that have not been processed, i.e., their ids do not appear in the Processed table. I'm noticing that when I make an update to the Processed table the changes are not immediately reflected in the lambda result. That is, the lambda still returns students that have been marked as processed. Even though the data in the database has changed. I have verified the updated state of the database manually. Is it possible that the lambda is caching somewhere? I'm executing the lambda from the AWS console so there are no layers there.

I also noticed that if I make a minor change to the lambda code, save it, and then execute it, I get the correct results. Thanks for any help.

posta 4 anni fa570 visualizzazioni
1 Risposta
0

I figured it out. I was creating the session object outside the lambda handler which caused it to be cached. I moved session creation inside the handler and everything works now.

con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande