This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Application Managed EntityManagerFactories

Jorge Moran
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Coderanch has been really helpful for me... but this is the first time I haven't been able to find a topic that describes the problem Im having...

I'm developing an application using EJB3 and Icefaces... the thing is that after the user authenticates, I have to get a parameter from the database, which indicates the name of the persistence unit that specific user will have to use in the subsequent calls to every other enterprise bean. Most of the methods (I would even say, all of the methods are stateless) so the obvious thing to do would be
to use stateless beans, nevertheless since the persistence unit is different depending on the user... that wouldn't be the correct approach; neither would it be to make all of the other beans stateful just because the persistence unit is dynamic.

Any ideas of what the right solution would be?

Thanks in advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic