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

NH-3087 pre-work #91

Closed
wants to merge 1 commit into from
Closed

NH-3087 pre-work #91

wants to merge 1 commit into from

Conversation

IronsUK
Copy link

@IronsUK IronsUK commented Mar 15, 2012

https://nhibernate.jira.com/browse/NH-3087

Some pre-work refactoring to support multi tenancy feature, to be implemented later.

  • Refactored EntityKey and CacheKey creation to be centralized to ISessionImplementor (implemented in AbstractSessionImpl)
  • Key creation takes tenantIdentifier into account
  • Added MultiTenancyStrategy enum for SessionFactory configuration and integrated into Settings
  • Changed SessionFactoryImpl.EvictEntity(string entityName, object id) and EvictCollection(string roleName, object id) to throw an exception when the multi-tenancy strategy is not NONE and there is no session context

No change to the public API and no new features added. Tests passed ok after refactoring. I would have added a test for the SessionFactory cache eviction change but it looks like those methods are untested currently.

Some pre-work refactoring to support multi tenancy feature, to be implemented later.

- Refactored EntityKey and CacheKey creation to be centralized to ISessionImplementor (implemented in AbstractSessionImpl)
- Key creation takes tenantIdentifier into account
- Added MultiTenancyStrategy enum for SessionFactory configuration and integrated into Settings
- Changed SessionFactoryImpl.EvictEntity(string entityName, object id) and EvictCollection(string roleName, object id) to throw an exception when the multi-tenancy strategy is not NONE and there is no session context
oskarb added a commit that referenced this pull request May 26, 2012
…l. This is in preparation for multi tenancy (NH-3087). Based on work by Paul White in pull request #91.
@oskarb
Copy link
Member

oskarb commented May 26, 2012

Paul,

Thanks for the patch, however there were some issues:

  • The NHibernate project use tabs for indenting.
  • The patch touch a large number of files because of the EntityKey centralization. Understandable, but I would have preferred a separate commit with just the centralization and nothing else.

It has also unfortunately taken some time to get to this, so the patch required some tweaks for merging anyway.

As a first step I have extracted the EntityKey and CacheKey creation centralization and pushed that to master. I have pushed the remainder of the patch, with some indenting cleaned up and rebased to current master, to a separate branch: https://github.com/oskarb/nhibernate-core/tree/NH-3087-prelim. At the moment I haven't decided how to proceed with this. It might not be a good idea to merge settings for multi-tenancy when those settings really aren't implemented yet.

A couple of more tips:

  • You may want to set up you git with a proper name/email since this show up in the commit log.
  • I recommend you use separate topic branches for all work - doing work directly on local master tends to make merging with upstream master more difficult.

@IronsUK
Copy link
Author

IronsUK commented May 31, 2012

Thanks for reviewing this and for the information. I would like to continue to contribute to this feature though it could be a while before I can work on it.

What is the most appropriate way for me to continue? Branch your NH-3087-prelim branch and push patches to that?

@oskarb
Copy link
Member

oskarb commented Jul 5, 2012

Hi Paul,

Sorry about late reply. For continuing the work, I think the best would be to create a new topic branch from current upstream master (to avoid the commits from your initial work "polluting" the subsequent pull request), and then cherry-pick from the branch I created. Try to divide the work logically into several smaller commits (easer to review), avoid large whitespace-changes, and avoid changing the new-line character (makes reviewing and history tracking more difficult).

@oskarb
Copy link
Member

oskarb commented Sep 25, 2014

Closing this PR. Some parts were merged, others where placed in a branch as noted above and in the Jira issue in case someone wants to pick it up and continue.

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

Successfully merging this pull request may close these issues.

2 participants