◐ Shell
clean mode source ↗

fix: Fixed transaction handling with SQLite registry by ntkathole · Pull Request #5588 · feast-dev/feast

What this PR does / why we need it:

This PR fixed the SQLite database lock issue in the Feast SQL Registry. The error sqlite3.OperationalError: database is locked was occurring because the _set_last_updated_metadata method was being called from within the _apply_object method's transaction context, but _set_last_updated_metadata was trying to start its own transaction with self.write_engine.begin(). This created a nested transaction scenario that SQLite doesn't handle well.

Modified the methods now to accept an optional connection parameter to use the existing transaction (for calls from within other transactions).

Which issue(s) this PR fixes:

Fixes #5565