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.

demandé il y a 4 ans573 vues
1 réponse
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.

répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions