On Sun, May 06, 2001 at 08:03:42PM -0700, Scott M Stark wrote:
> We use a double indirection layer to resolve the JNDI name for an
>ejb-jar/resource-ref
> element and I don't see why this can't be handled by a single layer. For example,
>given
> a javax.sql.DataSource reference in an ejb-jar like
>
> <ejb-jar>
> <enterprise-beans>
> <session>
> <ejb-name>TheSession</ejb-name>
> ...
> <resource-ref>
> <res-ref-name>jdbc/MyDS</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Contaner</res-auth>
> </resource-ref>
> </session>
> </enterprise-beans>
> </ejb-jar>
>
> requires a jboss.xml descriptor like the following to map this to java:/DefaultDS
>
> <jboss>
> <enterprise-beans>
> <session>
> <ejb-name>TheSession</ejb-name>
> <resource-ref>
> <res-ref-name>jdbc/MyDS</res-ref-name>
> <resource-name>DefaultDS</resource-name>
> </resource-ref>
> </session>
> </enterprise-beans>
>
> <resource-managers>
> <resource-manager res-class="javax.sql.DataSource">
> <res-name>DefaultDS</res-name>
> <res-jndi-name>java:/DefaultDS</res-jndi-name>
> </resource-manager>
> </resource-managers>
> </jboss>
>
> But the resource-managers/resource-manager really only specifies res-jndi-name value.
> Why not simply allow the following and drop the use of resource-managers?
My understanding is that the purpose of the double indirection is to make the
case where you have many beans and many resources in the the one file more
manageable.
<res-ref-name> describes what the resource *does*
<resource-name> describes what the resource is *called*
<res-jndi-name> describes where the resource is *located*
During development all of your resource might be located in the one DBMS, e.g.
HSQL or something. In production you might choose to separate the inventory
database to an external Oracle instance, but leave the product and accounts
databases running somewhere else.
I agree that the double indirection causes a lot of confusion. Perhaps we can
make it optional?
Toby.
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development