Hi!

Manie Coetzee wrote:
> I was hoping that I could just specify something in
> the jboss.xml file.  

What I'm saying is that you don't have to do ANYTHING. Just use the
java:/xxx name. Example:
DataSource ds = (DataSource)new
InitialContext().lookup("java:/DefaultDS");

> One thing I also don't understand
> is that the "java:/cmdDS"  (cmsDS being my data source) is accesable by
> the beans but not by an
> outside client, 

This is because connection pools can only be used by code inside the
JVM.

> so under which namespace to you register the data source
> in the JNDI tree so that it is available for any proccesses outside the
> container.  

None.

> There must be a special namespace for doing that.  

Nope. That would be illegal. A connection pool has no meaning outside of
the JVM.

> Tell me
> also why it's not good to reference the data source in my initial
> context?

You mean in beans? Sure, you can do that but:
a) perhaps you want to port your app to another server, and that another
server does not allow it
b) Everytime you change the name of the datasource you need to change in
all your beans that use it and recompile

It is better to have one level of indirection so that you can hardcode
references in your beans. That is the whole idea behind the
java:comp/env namespace anyway.

> You menthioned the ...ctx.bind(....  Where exactly do you do this?

In your code.

So, no you cannot use the connection pools from JVM's outside of JBoss.
What you *can* do is create a session bean that does this for you, and
which you call in the beginning of your test run to do cleanup.

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to