On Sun, 10 Nov 2002, Will Senn wrote:

> Date: Sun, 10 Nov 2002 00:12:04 -0600
> From: Will Senn <[EMAIL PROTECTED]>
> Reply-To: Jakarta Commons Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: SQL Server and Connection Pooling help
>
> All,
>
> I really need some help.  Here is a snippet of code that in no way
> works.  Can you help?
> I really just want to set up a JNDI filesystem binding for a SQL Server
> 2000 connection pool,
> I was able to register and use the simple datasource in a similar
> fashion without any probs. The
> problem with the code below is that the PoolingDataSource is apparently
> the wrong object
> to bind (tell me what the right one is, pretty please?).  The error
> message I get is:
> Exception: javax.naming.OperationNotSupportedException: Can only bind
> References or Referenceable objects
> javax.naming.NamingException: resolved: null, unresolved: null
>
> Desire:
> 1. Create a new SQL Server 2000 Connection Pool

That part works, right?  In other words, can you successfully construct a
data source that is usable in the *current* application (forgetting about
JNDI for a moment)?

> 2. Bind it to a Filesystem JNDI Service Provider

This is never going to work :-(

The reason is that you're asking the filesystem JNDI provider to serialize
some Java objects (the data source and the underlying connections).  Such
objects are not serializable, because (among other things) they include
open network sockets that will only work in the JVM that created them.

> 3.  Use it in another java app.
>

If you're running in a servlet container like Tomcat, or in any J2EE app
server or app client environment, you should be able to use the JNDI
facilities of that environment to provide this for you.  If you're not,
you are going to need to fake it -- but I don't know of any strategy for
this that will work across different JVMs.

> Thanks,
>
> Will
>

Craig McClanahan


--
To unsubscribe, e-mail:   <mailto:commons-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-user-help@;jakarta.apache.org>

Reply via email to