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

Multi Tenant implementation for single database environments - Use grails-filtering and grails-hibernate-hijacker
Apache License 2.0
32 stars 25 forks source link

Change Hawk Events to Platform Core UI #25

Open alxndrsn opened 11 years ago

alxndrsn commented 11 years ago

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.

kimble commented 11 years ago

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.

kimble commented 11 years ago

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..

alxndrsn commented 11 years ago

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?

kimble commented 11 years ago

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.

kimble commented 11 years ago

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

kimble commented 11 years ago

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.

alxndrsn commented 11 years ago

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.

MaximumDamage commented 11 years ago

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

sronderos commented 11 years ago

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

alxndrsn commented 11 years ago

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

kimble commented 11 years ago

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.