>Thanks for reply and hints ...
>
>> Nope, but it should work. Are you using multiple DS's *per bean* or do
>> you just have a generic BMP base entity which you extend to multiple
>> BMP's with different DS's?
>
>I think I should be more clear: I need to implement a generic bean which
reads
>the metadata of a specified database/table and initialize the internal
>variables - stores the database structure and schema - (the definition of
the
>bean content so to say). I use the same class for different tables with
>different DS.
Ok. But only one DS per deployed bean?
>ent variables? You know you're not allowed to
>> read files in EJB's...
>
>I've tried to use the env-entry tags to set the env for the bean, but it
seems
>that the env-entries are available at the running time when the bean was
>already created and not by creation time .... ?? Am I wrong ??
Yes, you're wrong :-) They are always available in bean methods, even create
methods.
> The bean
>receive the entity context as initial context from the container but
without
>those information that are specified in the deployment descriptor
(env-entry
>info).
You don't get the environment entries from the entity context. Are you
referring to getEnvironment()? That has been deprecated. Use the
java:/comp/env JNDI namespace instead (i.e. new
InitialContext().lookup("java:comp/env/jdbc/BeanDS")).
>> It seems like the easiest way to do this is to have a resource reference
>> "java:comp/env/jdbc/BeanDS" that you configure on jboss.xml for each
>> bean to point to the respective database. Use environment entries for
>> table names etc.
>
>Yes, but if i use the same bean class then the pool name could not be hard
>coded.
Sure you can. You are not hardcoding the name of the real pool, you are
hardcoding the name of your reference to it. BIIIG difference. You can have
"java:comp/env/jdbc/BeanDS" point to *either* "java:/HypersonicDS" or
"java:/OracleDS" or.. etc. So the name can indeed be hardcoded. That's the
whole point.
I suggest that you look again into how environment entries and resource
references work in EJB 1.1.
/Rickard
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]