Hi,

the question was why I cannot do it ? The question was not why I want to do
this without using EJB,
the challenge was to find out how can I use JNDI to do that from a
standalone JAVA Client
which accesses a JNDI Service.

But as far as I know now it is possible, because the use of JNDI is not
bound to EJB.

Frank


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of David Jencks
Sent: Friday, July 06, 2001 8:10 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] Datasource Lookup from a standalone client


Hi,

(I am not a jndi expert, so some of the things I say ought to work might
not.  If I say they won't, I'm pretty sure they won't)

There are DataSources and DataSources.  Some DataSources simply hand out
jdbc1.0 connections, just like calling DriverManager.getConnection, except
you can put the configuration info into the datasource bound in jndi.  My
understanding (possibly wrong) is that when you look one of these up, jndi
starts up a DataSource in the vm of the looking up process.  I believe for
example Borland's InterClient does this.

The DataSources in JBoss and implied (as ConnectionFactory's) by the jca
spec are a bit more complicated: they are a facade that hands out temporary
handles to actual db connections which are pooled and have their
transactions managed elsewhere.  (IMHO reusing the Connection interface for
these is bogus, the transaction control methods shouldn't be there, or at
least use the cci LocalTransaction interface).  Since Connections usually
aren't serializable, and I would hope they wouldn't be, in order to get a
connection from one of these facade DataSources, you'd have to start up all
the pooling and transaction management machinery in your process's vm in
order to use the connection.  If you want that much infrastructure running,
I think you should be configuring it yourself so you know what you're
getting.

In fact jca resource adapters do provide an "unmanaged" mode, which is
expected to provide by default trivial (no) connection pooling.  You might
possibly be able to adapt the jbosscx module to deploy a resource adapter
(such as a jbosspool wrapped jdbc driver) into your standalone client.
However, why would you want to do this? If you aren't using the
architecture you get with an ejb framework, why are you bothering with
ejb's in the first place?

david jencks

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to