Skip to content
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

Get objects that will be peristed #139

Open
hg-ms opened this issue Feb 8, 2024 · 3 comments
Open

Get objects that will be peristed #139

hg-ms opened this issue Feb 8, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@hg-ms
Copy link
Contributor

hg-ms commented Feb 8, 2024

thanks @hg-ms
do you think it might be of interest for you guys to incorporate some sort of a listener API for this inside the code?
I am thinking about potential use cases like outbox pattern, Change Data Capture integration etc...
this would be beneficial I think...

Originally posted by @guykatz in #134 (reply in thread)

@hg-ms
Copy link
Contributor Author

hg-ms commented Feb 8, 2024

There is a way to get all objects that will be persisted, but it is a bit hacky:
To do so you need to create a storer and cast it to BinaryStorer.Default.
Between the store and commit you can retrieve all objects that will be persisted.

BinaryStorer.Default storer = (Default) storage.createLazyStorer();
storer.store(root);
storer.iterateMergeableEntries((oid, instance) -> {System.out.println("oid: " + oid + " instance: " + instance);} );
storer.commit();

This is not very user friendly, mybe we can add a more convenient API

@hg-ms hg-ms added the enhancement New feature or request label Feb 8, 2024
@hu-chia
Copy link

hu-chia commented Feb 22, 2024

vote + 1, the feature could be a good alternative for mongodb change stream.

@fh-ms
Copy link
Contributor

fh-ms commented Apr 17, 2024

Maybe we should consider adding a concept like the Hibernate interceptors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants