Merge pull request #269 from dennishendriksen/master

Close entity manager factory
Merge pull request #271 from dennishendriksen/master

Bug: fix indexing
remove printStackTrace statement
only match on xref fields, not on non-xref fields with same value