tg icon indicating copy to clipboard operation
tg copied to clipboard

Session to maintain a list of persisted entities

Open 01es opened this issue 5 years ago • 0 comments

Description

Saving of modified and new entity instances happens in a database transaction. Transactional scope is demarcated by @SessionRequired. Hence, in TG applications, transactions are referred to as "sessions". Transactional scopes are enabled by SessionInterceptor, which handles start/commit/rollback database transactions, nested transactional scopes and performs other orchestration.

One or more entity instances may get persisted in one session. This issue covers the work required to make tracking of entity instances what were persisted (or rather attempted to be persisted) in a session more explicitly. Ability to access a definitive list of persisted entities will enable implementation of more advanced features that have to do with processing of such instances at the end of committed or rolled back transactions. Both the original instances and those returned from save should be made accessible within SessionInterceptor.

Expected outcome

This functionality is a plumbing to enable implementation of more advanced features such auditing, making passed-in for saving entity instances immutable, and more.

01es avatar Jul 29 '20 04:07 01es