Hi,
it is currently not possible to dynamically specify, after
bean deployment, which datasource should be used by a CMP entity
bean. The datasource is statically specified in the deployment
descriptor of the CMP entity bean (the jonas-specific one). We have
no plan to change this feature.
One way to solve your problem, several clients using the
same EJB application but accessing different databases, is to
deploy your CMP entity bean as many times as you have datasources.
I.e. for each database, you define a datasource, and you define a
deployment descriptor for your CMP entity bean (each depl desc with
the same classes and features, but with a different ejb name, home name
and a different datasource name !).
Depending on your client identity, the client application will use
one of the deployed CMP entity beans, by using the corresponding
ejb home name ... (it is then a matter of client configuration ...).
Best Regards,
François
Weißböck Maximilian wrote:
> Hi all!
>
> I have a question to discuss, where CMP beans of the same
> type shuld be mapped to different database-userspaces
> for security reasons.
>
> Let me explain:
>
> We have (lots of) customers with very critical data
> how need to use all the same application but how can,
> for security resons, not share the same table space.
>
> What we do so far is to start a JOnAS for each customer
> with its own Datasource configuration file, so each JOnAS
> uses a different username/password and a different table space
> and each customer uses its own JOnAS.
>
> This will work for some 10 customers, but not for some 100...
>
> What we like to do is to keep the separate table spaces
> but to use only 1 JOnAS for all the customers.
>
> The primary key of all our CMP beans is designed in a way
> that makes it technically possible to hold all the data in
> just one table space - the primary keys are never the same,
> regardless in what table space a CMP bean is stored.
>
> So lets say, we have the information about the table space
> in the PK.
>
> What we also know is the user that is logged in, and each
> user is mapped to a table space.
>
> If we had used only BMP beans (and not CMP beans), I could think
> of a simple mechanism that would allow me to find the Datasource
> the bean belongs to, as I can use the user information from the
> login and/or the table space information from the primary key
> to get the datasources the BMP bean belongs to.
>
> (Just define as many Datasorces as there are customers and
> map the lookup(), depending on the user or PK information
> to the correct Datasource)
>
> BUT - What I want to know, is there any possibility to still
> use CMP beans an configure them in a way so they use the correct
> Datasource?
>
> Are there any plans to support this scenario?
>
> Thanks, Max
>
> PS. This also shuld work with Oracles virtual private database.
> ---
> Dipl.-Ing. Maximilian Weißböck
> i-online Software AG
> Tel.: +43 2236 3080 3785
> Handy: 0699 1888 3785
> Fax: +43 2236 3080 24 3785
> mailto:[EMAIL PROTECTED]
> http://www.i-online.cc
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
--
==================================================================
Francois EXERTIER Evidian (Groupe Bull)
1, rue de Provence, BP 208, 38432 Echirolles cedex, FRANCE
mailto:[EMAIL PROTECTED]
http://www.evidian.com/jonas http://www.objectweb.org/jonas
Tel: +33 (0)4 76 29 71 51 - Fax: +33 (0)4 76 29 77 30
==================================================================
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".