LDAP Datastores

DataNucleus supports persisting/retrieving objects to/from LDAP datastores (using the datanucleus-ldap plugin). Support for LDAP is in its early stages and will be enhanced in future releases. If you wish to help out in this effort either by contributing or by sponsoring particular functionality please contact us via the DataNucleus Forum.

Datastore Connection

The following persistence properties will connect to an LDAP running on your local machine

datanucleus.ConnectionDriverName=com.sun.jndi.ldap.LdapCtxFactory
datanucleus.ConnectionURL=ldap://localhost:10389
datanucleus.ConnectionUserName=uid=admin,ou=system
datanucleus.ConnectionPassword=secret


So you create your PersistenceManagerFactory or EntityManagerFactory with these properties. Thereafter you have the full power of the JDO or JPA APIs at your disposal, for your LDAP datastore.

Connection Pooling

The following persistence properties will enable connection pooling

datanucleus.connectionPoolingType=JNDI

Once you have turned connection pooling on if you want more control over the pooling you can also set the following persistence properties

  • datanucleus.connectionPool.maxPoolSize : max size of pool
  • datanucleus.connectionPool.initialPoolSize : initial size of pool


Queries

Access Platform allows you to query the objects in the datastore using the following

  • JDOQL - language based around the objects that are persisted and using Java-type syntax
  • JPQL - language based around the objects that are persisted and using SQL-like syntax

Queries are evaluated in-memory.



Known Limitations

The following are known limitations of the current implementation

  • Datastore Identity is not currently supported
  • Optimistic checking of versions is not supported
  • Identity generators that operate using the datastore are not supported
  • Cannot map inherited classes to the same LDAP type