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

using IPostInsertEventListener - OnPostInsertAsync not called #1826

Closed
Nazgaul opened this issue Aug 19, 2018 · 5 comments
Closed

using IPostInsertEventListener - OnPostInsertAsync not called #1826

Nazgaul opened this issue Aug 19, 2018 · 5 comments

Comments

@Nazgaul
Copy link

Nazgaul commented Aug 19, 2018

Hi.
I'm trying to implement Event bus using nhibernate event system. I implemented IPostInsertEventListener and added functionality on OnPostInsertAsync. and OnPostInsert didn't do anything.

My entire flow with nhibernate is with async operation (commitAsync, AddAsync,LoadAsync etc)
I put a breakpoint on my system and saw that OnPostInsert function was selection and not the async.
Added nhibernate reference to my code in order to see what is the bug. this is my callstack

image

I saw that in AfterTransactionCompletionAsync the sync method of AfterTransactionCompletion is called and not the async version. why is that?

@fredericDelaporte
Copy link
Member

This is a limitation of the current async code generator. The transaction completion action queue fires delegates which in turn call these events. But the async code generator does not handle delegates, leaving these calls synchronous.

So in such cases, the synchronous events are raised instead.

@Nazgaul
Copy link
Author

Nazgaul commented Aug 20, 2018

I see - so no way around this. thanks. too bad :) thanks for letting me know.

@Nazgaul Nazgaul closed this as completed Aug 20, 2018
@hazzik
Copy link
Member

hazzik commented Aug 22, 2018

It is covered by #1452 and #1752.

@Nazgaul
Copy link
Author

Nazgaul commented Aug 22, 2018

Thanks. I'll subscribe to those issues.
I'll be waiting for that issue to get fixed. It'll be great for implementation event handler.

@hazzik
Copy link
Member

hazzik commented Aug 22, 2018

Duplicate of #1452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants