That's the best way to ensure that all the columns are fetched eagerly and
prevent errors later when trying to access lazily loaded attributes outside
of the session/thread.
- Added `wait_start()` method that other threads can use to synchronize
with the engine and wait before performing db operations.
- Callback logic wrapped in a try/except block to prevent custom
integrations with buggy callbacks from crashing the engine.
ImportErrors on these entity modules will be ignored when dynamically
loading them, since they have optional external dependencies and we
shouldn't throw an error if we can't import them.
- Support for an optional callback on `publish_entities` to get notified
when the published object are flushed to the db.
- Use `lazy='selectin'` for the entity parent -> children relationship -
it is more efficient and it ensures that all the data the application
needs is loaded upfront.
- `Entity.entity_key` rolled back to `<external_id, plugin>`. The
fallback logic on `<id, plugin>` created more problems than those it
as supposed to solve.
- Added `expire_on_commit=False` to the entities engine session to make
sure that we don't get errors on detached/expired instances.
- Better logic to recursively link parent/children entities, so partial
updates won't get lost.
- Removed `EntitiesCache` - it was too much to maintain while keeping
consistent with the ORM, and it was a perennial fight against
SQLAlchemy's own cache.
- Removed `EntityNotifier` - with no need to merge cached entities, the
`notify` method has become much simpler and it's simply been merged
in the `EntitiesRepository`.
SQLAlchemy 2 has introduced several breaking changes that can break
several things in the application - especially where the code uses
`connection.execute()` with raw SQL statements.
We need to temporarily force the installation of versions from the 1.x
branch, while migrating the existing code to the new version.
Exceptions that cause the termination of the plugin's loop should always
be logged as such, unless the plugin is supposed to stop and various
exceptions may occur upon teardown.