Ok.  New problem.  I am connecting properly and all I had to do was set
the "useAutoCommit" to "2".  Guess I could have read the docs a bit better
before.  (I created a PlatformLDAPImpl but haven't even needed to use it.)

But now, LDAP doesn't like the prepared statement:

GOOD:
----------------------------------------------------
SELECT cn,objectClass,dn,objectGUID,description,name
FROM OU=IT,DC=Alloy,DC=inc WHERE objectClass='group'

BAD:
----------------------------------------------------
SELECT A0.cn,A0.objectClass,A0.dn,A0.objectGUID,A0.description,A0.name
FROM OU=IT,DC=Alloy,DC=inc A0 WHERE A0.objectClass='group'

Seems LDAP really doesn't like the "A0" part of the prepared statement.
Any way to get rid of that in the SELECT?

Thanks again.


Charlie


Armin Waibel said the following on 1/27/2005 11:14 AM:

Hi Charles,

> I know this is a bit bizarro, so any ideas or theories are appreciated.
> Should I consider trying to write my own PlatformLDAPImpl class? Just a
> thought.


I think currently this will be the easiest way to go. Implement
PlatformLdapJdbcImpl.initializeJdbcConnection and
PlatformLdapJdbcImpl.changeAutoCommitState
as a noop-method. Within these methods OJB try to set the autoCommit state of the connection.
I think in future releases of OJB the ConnectionFactoryAbstractImpl.initializeJdbcConnection method should be removed, but currently it was used.



regards, Armin



Charles N. Harvey III wrote:

Ok.  I know this is a weird one, but here goes.

I downloaded the ldapJdbc driver from openldap.org the other day. It allows
one to write SQL queries which are then translated into LDAP requests. Its
pretty neat so far. I am trying to use OJB like I would in any other project
and just put the ldapJdbc jar in for the driver.


   <jdbc-connection-descriptor
           jcd-alias="test-ldap"
           default-connection="true"
           platform=""
           jdbc-level="4.0"
           driver="com.octetstring.jdbcLdap.sql.JdbcLdapDriver"
           protocol="jdbc"
           subprotocol="ldap"
           dbalias="//192.168.195.2:389/?SEARCH_SCOPE:=subTreeScope"
           username="domain\jauthenticator"
           password="mypassword"
           eager-release="false">

What should I use for the "platform"? If I leave it blank I am pretty sure
that OJB falls back on whatever the default is.


But, that isn't where I am getting a problem. OJB is trying to use transactions
and the LDAP driver doesn't allow that.


-----------------------------------------------------------------------------------

Caused by: org.apache.ojb.broker.accesslayer.LookupException: Platform dependent initialization of connection failed at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.initializeJdbcConnection(ConnectionFactoryAbstractImpl.java:157)

at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnectionFromDriverManager(ConnectionFactoryAbstractImpl.java:272)

at org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl.getConnectionFromPool(ConnectionFactoryNotPooledImpl.java:40)

at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnection(ConnectionFactoryAbstractImpl.java:116)

at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(ConnectionManagerImpl.java:105)

at org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(StatementManager.java:637)

... 55 more
Caused by: org.apache.ojb.broker.platforms.PlatformException: Connection initializing: setAutoCommit(true) failed
at org.apache.ojb.broker.platforms.PlatformDefaultImpl.initializeJdbcConnection(PlatformDefaultImpl.java:160)


at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.initializeJdbcConnection(ConnectionFactoryAbstractImpl.java:153)

... 60 more
Caused by: java.sql.SQLException: LDAP Does Not Support Transactions
at com.octetstring.jdbcLdap.jndi.JndiLdapConnection.setAutoCommit(JndiLdapConnection.java:478)


at org.apache.ojb.broker.platforms.PlatformDefaultImpl.initializeJdbcConnection(PlatformDefaultImpl.java:154)

... 61 more
-----------------------------------------------------------------------------------




At the base of it is the SQLException about LDAP not supporting transactions.
Can I turn that off somewhere in the OJB.properties?


I know this is a bit bizarro, so any ideas or theories are appreciated.
Should I consider trying to write my own PlatformLDAPImpl class? Just a thought.


Thanks a lot.



Charlie



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




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




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



Reply via email to