tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: 2 web apps - 1 ejb - 2 db?
Date Wed, 01 Apr 2009 20:57:44 GMT

On Apr 1, 2009, at 1:24 PM, Martin Uhlir wrote:

> assume, I have two (very similar) web applications (let's call them  
> A and B) which uses EJB as backend. The question is, how I can  
> achieve, that the application A stores its data to a database  
> SchemaA, while the application B stores its data to database  
> SchemaB, while both applications use the same EJB module (storing  
> the data from A and B is done via the EJB)? I want to avoid running  
> (developing) two EJB modules with the same functionality.
> So is it somehow possible to achieve this just with some kind of  
> configuration or is there any other way how to solve this?
> Note that the web applications will run on one server, while the EJB  
> on a different one.

Hi Martin,

No way to do this as far as I know.  Even assuming you did something  
very low level like wrapped the factory that creates the DataSources  
so that the DataSource you create depends on some kind of thread state  
which you set on in coming requests from webapp A or B, it still would  
quickly fall apart due to things like connection pooling.

Is there some kind of overhead to deploying the application twice that  
you'd like to avoid?  Note with the right descriptors you wouldn't  
need to modify the code at all.  Might be some features we can add  
there to eliminate any concerns.


View raw message