-->
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.  [ 4 posts ] 
Author Message
 Post subject: Multiple schema access
PostPosted: Mon May 18, 2009 7:11 pm 
Newbie

Joined: Mon May 18, 2009 6:59 pm
Posts: 3
Hi People,

I am looking for a solution to my problem for days but I didn´t find anything that could really help me.
In my app I am using JBoss 4.2.3 GA and EJB3.

What I need:
Allow that each customer of my system (Today 5 but more than 2000 sooner) have it own database (Can be the same database but diferent schema). I mean, use the same entities and sessions.

I tryied to create the entityManager inside my stateless session, but without success. Today I was deep inside the jboss code looking for the code that instantiates the EntityManager when I put the code
Code:

    @PersistenceContext(unitName = "default")
    protected EntityManager entityManager;

because I realized that if I found this code, I would be able to change the unitName programatically and force JBoss to instantiate the correct EM and then I wouldn´t have to change any session or entity code.

I beg anyone to give me a north, could be links, concepts or any kind of example. I would really apreciate that.

Thanks in advance.

Anderson Geison Borges.


Top
 Profile  
 
 Post subject: Re: Multiple schema access
PostPosted: Tue May 19, 2009 1:46 pm 
Newbie

Joined: Mon May 18, 2009 6:59 pm
Posts: 3
I also forgot to say that what I´m trying to do is easy to do with pure hibernate. Only some configuration objects and it´s done. The problem is really when I enter the JBoss world, with it´s automagic way of instantiate the EntityManager...


Top
 Profile  
 
 Post subject: Re: Multiple schema access
PostPosted: Thu May 21, 2009 2:34 pm 
Newbie

Joined: Mon May 18, 2009 6:59 pm
Posts: 3
so,

It seems that it is not possible...


Top
 Profile  
 
 Post subject: Re: Multiple schema access
PostPosted: Mon May 25, 2009 9:49 am 
Newbie

Joined: Mon May 25, 2009 3:12 am
Posts: 2
Hi Ander,

it seems you are facing a problem like mine.
viewtopic.php?f=1&t=997087

look at my proposed solution, however I'd like to ear from the hibernate guys if there are some critical drawback (ie in persistance cache or hibernate second level cache or in high concurrency ) that could come up in a long running env.

Ciao


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

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.