Fixes to JPA user session provider
Merge pull request #717 from stianst/master

Fixes to JPA user session provider