-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
22329: Transactional support in direct client, MINOR #335
base: main
Are you sure you want to change the base?
Conversation
77fc50c
to
5b9264b
Compare
@@ -468,12 +485,14 @@ def _get_trainee_from_engine(self, trainee_id: str) -> Trainee: | |||
persistence = metadata.get('persistence', 'allow') | |||
trainee_meta = metadata.get('metadata') | |||
trainee_name = metadata.get('name') | |||
transactional = metadata.get('transactional', False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like storing this in the model itself could easily get out of sync with the true transactional state. Is there way we could interrogate the entity to see its transactional state or track how its loaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the Amalgam C API layer, there's no way to query this back. The reverse of this is that there aren't that many ways to change the setting either: only the C LoadEntity
, CloneEntity
, and StoreEntity
API calls can change it. The corresponding HowsoDirectClient.create_trainee()
, copy_trainee(), and
persist_trainee()calls all deal with the client-side metadata correctly. The one other place that modifies the metadata state is
update_trainee()`, and that always preserves the current transactional setting.
I see the potential problem if something did manage to self.amlg.load_entity()
without going through the client layer, but I'm not sure there's somewhere better to put the (per-process/per-Amalgam) value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to store this in the python layer -- you wouldn't want to write this out because it is really a property of how you load it.
5b9264b
to
164bbdb
Compare
ea0144f
to
1ce9f37
Compare
Adds runtime options to the direct client. If you create a trainee as Trainee(persistence='always', runtime={'transactional': True}) then every operation will append a log entry to the .caml file. This is faster per operation, and all of the data continues to be recorded on disk, but the resulting files will be larger than always-persist mode without the transactional option.
e6d5e98
to
00ca0e7
Compare
Adds runtime options to the direct client. If you create a trainee as
then every operation will append a log entry to the .caml file. This is faster per operation, and all of the data continues to be recorded on disk, but the resulting files will be larger than always-persist mode without the transactional option.