DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38073>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38073

           Summary: [dbcp] JNDI problems with SharedPoolDataSource
           Product: Commons
           Version: 3.2
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


It is currently not possible to bind a SharedPoolDataSource into jndi and
retrieve it again via a lookup. The problem was seen in tomcat's naming
implementation, but is likely to be not limited to that implementation.
The problem is: SharedPoolDataSource implements javax.naming.Referenceable via
its parent InstanceKeyDataSource. Referenceable specifies that a getReference()
method is implemented, which returns a javax.naming.Reference object. The
reference object contains a reference to a factory for the object. In the
implementation of InstanceKeyDataSource, dbcp's InstanceKeyObjectFactory is
specified as facory. However, this is invalid as InstanceKeyObjectFactory is
abstract and cannot be instantiated, so upon a lookup, the object cannot be
retrieved from jndi.

There are two obvious solutions. First, getReference() could return the correct
factory (SharedPoolDataSourceFactory). Second, InstanceKeyDataSource could not
implement Referenceable any more.

The problem also occurs for dbcp's PerUserPoolDatasource. A successfull bind can
be done using dbcp's BasicDataSource.

I will attach a test case which shows the wrong behaviour. It depends on the
jars naming-common-5.0.28.jar and naming-java.5.0.28.jar which can be downloaded
from www.ibiblio.org/maven/tomcat/jars.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to