-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate filter with EntityManager
PostPosted: Thu May 24, 2012 1:06 pm 
Newbie

Joined: Thu May 24, 2012 12:53 pm
Posts: 1
Hi,

I use springdata JPA with Hibernate 3.5.6 and want to implement multi-tenancy. The difference between tenant is in tenant_id field in each entity. What I actually need is to run my select queries always with where tenant_id=XXX expression. I hoped to get it using Spring-AOP aspect for all findXXX methods provided by Spring data JPA. I've configured it with @Before annotation to enable filtering and put the correct tenant into it. I see it working via JUnit but when I start the entire server I get java.lang.IllegalStateException: No transactional EntityManager available. Do you have any idea of how to solve this? Should I think about another solution for getting the result that I need?

Thanks in advance,
Boris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.