-
When I try to make the second call from my backend (django), I get
What do I do? Should I close the connection, use a new database cache file every time, else? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To close a DuckDB connection in your Django backend and avoid conflicting locks when making a second call, you can use the def close(self) -> None:
"""Close the cache."""
self.connection.close() You should call this # Assuming you have an instance of Cache
cache = Cache()
# Perform your database operations
# ...
# Close the connection when done
cache.close() This will ensure that the DuckDB connection is properly closed and will help you avoid any conflicting locks when making subsequent calls [1]. |
Beta Was this translation helpful? Give feedback.
-
The fix was to set |
Beta Was this translation helpful? Give feedback.
The fix was to set
enable_cache=False
when creating the SmartDataframe instance.