> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Aaron Mulder
> Sent: Saturday, May 27, 2000 5:26 AM
> To: JBoss
> Subject: [jBoss-User] Resources - why? how?
>
>
> Okay, so with a horrible kludge, I forced jBoss to load the
> correct container configuration for my session bean. That configuration
> includes a resource reference:
>
> <resource-ref>
> <description>Database</description>
> <res-ref-name>OracleDB</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> The jboss.xml includes the resource manager for this resource
> reference:
>
> <resource-manager
> res-class="org.jboss.ejb.deployment.JDBCResource">
> <res-name>OracleDB</res-name>
> <res-jndi-name>xa.TestDB</res-jndi-name>
> </resource-manager>
>
> The JNDI name for the resource manager points to an instance of
> the connection pool I'm working on. I know that the resource is loaded,
> since I put in some debug code and got:
>
> [Container factory] Found a resource: OracleDB
> [Container factory] Found resource manager: OracleDB
> [Container factory] Found Data source. Bound to OracleDB, xa.TestDB
>
> So there is a valid resource object, and a valid resource manager
> object. If I read the code right, there should be a JDBCResource object
> bound to the JNDI name "OracleDB" which is a bean-specific reference to
> the global pool bound at "xa.TestDB".
Correct
> So I thought that the global
> bindings were not visible to the beans, only the bean-specific bindings
> for the resource references. If that is not the case, what is the purpose
> of the resource reference?
The global binding are seen by everyone but the been not knowing that the
deployed resource in under "xa.TestDB" normally would not access it (only
you, Aaron, the developer + deployer does). The resource ref is named by
Aaron the developer and is only a "local" knowledge. The resource ref is
bound to a global ref by Aaron the deployer and that global ref is seeing by
every one (it is a datasource). The bean scope of naming is just to reduce
noise to ratio and project a specific naming tree or "virtual filesystem" to
teh user.
> In any case, there is no object found when I try to lookup
> "OracleDB", and when I list the bound JNDI names, I get:
>
> [Default] Found Root Object: SQLTest: $Proxy0
> [Default] Found Root Object: jmx: org.jboss.jmx.server.JMXAdaptorImpl
> [Default] Found Root Object: xa.TestDB:
> org.minerva.datasource.XAPoolDataSource
> [Default] Found Root Object: TransactionManager: org.jboss.tm.TxManager
you must use java:... for OracleDB
it seems you list the default env and then this is correct (you do see
xa.TestDB).
> It looks like the resource reference is never bound to anything.
Again if you ran the test from the bean with java: you should see it but not
the above ;-)
> There was no NamingException which I would expect if it tried to bind to
> "xa.TestDB", and "xa.TestDB" is still bound to the original pool, as you
> can see. The only names I gave it were "OracleDB" and "xa.TestDB", and
> it's not bound to either! So how do you use it? Also, the original pool
> is bound as specified to "xa.TestDB", so I don't even need the resource
> reference. Now I'm *really* confused! What am I missing?
Again what is important is the difference between the "deployer" and the
"developer".
Try the following multiple personality desorder problem:
Start as "Aaron" the developer, tell yourself you don't know much about the
deployment env.
Then forget all you have done and as "Aaron the deployer" use the xml to
bind in the pro env.
you will see,
marc
>
> Thanks,
> Aaron
>
> P.S. Can we change the EJX GUI so it gives a drop-down for "Resource
> Type"? It wasn't immediately clear that the only valid values are
> "javax.sql.DataSource" or "java.net.URL".
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]