multi-tenant / grails-multi-tenant-single-db

Multi Tenant implementation for single database environments - Use grails-filtering and grails-hibernate-hijacker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Hawk Events to Platform Core UI

alxndrsn opened this issue · comments

Hi, would it be suitable to replace Hawk Eventing with Platform Core events? http://grailsrocks.github.com/grails-platform-core/guide/events.html

If so, I may have a go at changing it over, which I'd be happy to contribute when done.

Absolutely, getting rid of hawk eventing would make it easier to work with these plugins! I think I've mentioned it in another issue related to a reloading problem.

Oh, by the way, there are some issues related to sessions and transactions you might run into. I've not done any Grails programming for about a year so I've not looked into the event plugin, but you might run into some annoying, but often necessary issues related to whether an event listener should participate in the same transaction / Hibernate session as the sender of the event. I've always felt that coupling the receiver of an event to the sender via a common transaction / session defies the purpose of events, but I guess it's hard to work around that here..

Thanks for the pointers!

Ref listeners getting sucked into the sender's transaction: are these problems already present, or just a possibility when replacing Hawk Events with Platform Core? Would a simple workaround be to make the event processing asynchronous?

I have to admit that I don't remember the problems in detail, but there should be tests in place for the things I struggled with. Someone has registered a somewhat related issue regarding inheritance of thread local variables.

I hope that replacing Hawk Eventing will solve at least some of the reloading problem reported in #17 (one of the last comments).

You've probably seen this, but it's probably a good idea to start by replacing the hawk-eventing dependency in hibernate-hijacker before multi-tenant-single-db.

Yeah, didn't seem to be much hawk stuff in multi-tenant-single-db itself.

As a first step, I was thinking just to rework Hawk itself to use Platform Core under the hood, and then work through from there. Hopefully will get some time to work on this next week.

+1 and thanks for this ! It will help a lot.

Has anyone had any time to work on this? If not I may take it up.

I've not got round to it, so feel free.

Seems like Grails 2.3 will be shipping with some built in event support? Might be worth looking into.. Recent versions of Hibernate seems to be coming with some multi-tenant support out of the box. Might be worth looking into.