[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Regarding Octet String JDBC LDAP Bridge



Actually, it seems that everyone is right more or less.

Yes: There is a bug where the wrong context is being searched to verify
the connection, but I am checking for an exception to ensure the
connection is open, so it shouldn't impact the queries.

Yes: The base specified in the connection string and the base specified
in the search base or the context being created can not overlap.

In the case of an insert the bridge is creating a new context and the
new context is what you are inserting to.  So this would mean that the
statement:

INSERT INTO cn=Marc,ou=People (obejctClass,objectClass,cn,sn) VALUES
(top,person,Marc,Boorshtein)

creates a new entry called cn=Marc,ou=People,dc=... and that the new
context is beneath the base.  To be able to have a prepared statement
where the new context is based on some values, you would need a
statement that looks like:

INSERT INTO cn,ou=People (objectClass,objectClass,cn,sn) VALUES
(top,person,?,?)

Where the first "?" would be the cn and the second "?" would be the sn.

Hope this helps.

Marc Boorshtein

On Wed, 2003-09-24 at 08:24, Clemens Helf wrote:
> To get some idea of the problem, I looked into the sources, especially 
> into 'com.octetstring.jndi.JndiLdapConnection.java'. To my understanding 
> there is a bug in method 'public boolean isClosed()'.
> 
> This method is called by the JndiLdapConnection()-constructor after 
> having created an 'InitialDirContext' to check the context.
> isClosed executes 'con.lookup(baseDN)', instead of 'con.lookup("")', 
> which leads to a lookup of 'ldap://host:port/baseDN,baseDN' which fails 
> if 'baseDN!=null'. Perhaps Marc Boorshtein would like to comment on that 
> observation.
> 
> Another answer to this thread by C. Rahul mentions a workaround: create 
> the connection with an empty baseDN. Even my 'INSERT INTO' works like that.
> 
> Prajakta Kalekar wrote:
> > Yes, I am faced with the exact same problem.
> > Prajakta Kalekar.
> > 
> > -----Original Message-----
> > From: owner-openldap-software@OpenLDAP.org
> > [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Clemens Helf
> > Sent: Wednesday, September 24, 2003 2:10 PM
> > To: openldap-software@OpenLDAP.org
> > Subject: Re: Regarding Octet String JDBC LDAP Bridge
> > 
> > 
> > I am experiencing the same problem with the same stack trace.
> > 
> >  From the stack trace, I concluded, that no query has been issued yet,
> > so there can be no overlap between a query and the connection. To verify
> > my point, I removed the query from the source code and the same
> > exception is thrown.
> > 
> > Despite the exception, the code continues to operate, so the exception
> > output is probably generated within a catch clause. I could successfully
> > execute a SELECT query despite the exception, but I was not able to
> > execute an INSERT INTO query.
> > 
> > Clemens Helf
> > 
> > Marc Boorshtein wrote:
> > 
> >>This generally means that the base of the connection and the base of the
> >>query overlap, for example when search o=People,c=us the connection
> >>could be at c=us and the search base should be ou=People.
> >>
> >>Marc Boorshtein
> >>
> >>On Tue, 2003-09-16 at 01:13, Prajakta Kalekar wrote:
> >>
> >>
> >>>Hi,
> >>>	I am using Octet String's JDBC LDAP Driver for accessing iPlanet
> >>>Directory Server data.
> >>>
> >>>After connection has been established, I get the following error:
> >>>
> >>>javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such
> > 
> > Object];
> > 
> >>>remaining name 'o=enlistautomatedtesting.com'
> >>>	at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
> >>>	at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
> >>>	at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
> >>>	at com.sun.jndi.ldap.LdapCtx.c_lookup(Unknown Source)
> >>>	at com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(Unknown
> >>>Source)
> >>>	at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(Unknown
> >>>Source)
> >>>	at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(Unknown
> >>>Source)
> >>>	at javax.naming.InitialContext.lookup(Unknown Source)
> >>>	at
> >>>com.octetstring.jdbcLdap.jndi.JndiLdapConnection.isClosed(JndiLdapConnecti
> > 
> > on
> > 
> >>>.java:270)
> >>>	at
> >>>com.octetstring.jdbcLdap.jndi.JndiLdapConnection.<init>(JndiLdapConnection
> > 
> > .j
> > 
> >>>ava:241)
> >>>	at
> >>>com.octetstring.jdbcLdap.sql.JdbcLdapDriver.connect(JdbcLdapDriver.java:75
> > 
> > )
> > 
> >>>	at java.sql.DriverManager.getConnection(Unknown Source)
> >>>	at java.sql.DriverManager.getConnection(Unknown Source)
> >>>	at octetString.Connect.main(Connect.java:38)
> >>>
> >>>	What can I do to overcome this problem? I require a solution to this
> >>>problem urgently. Any pointers will be extremely valuable.
> >>>Thank you,
> >>>Prajakta Kalekar.
> > 
> > 
> > 
-- 
Marc Boorshtein <marc.boorshtein@octetstring.com>
OctetString