LDAP Transaction / Java / RDBMS

7

75blured

Hi,

Do you know if there is any way to use transaction between a RDBMS
backend like Oracle or MySql & an OpenLDAP directory ? Indeed, I've got
a process which make some updates on Database1 then on LDAP then on
Database2. So, if the LDAP update fails then the Database1 data should
be rollbacked. And if the Database2 fails the ldap update should be
rollbacked.

The commit should be done only if DB1, LDAP and DB2 updates are OK. So,
it really looks like 2PC transaction. However, the fact is the
transactions are supported only on RDBMS or JMS queues. The LDAP does
not support transactions of that sort.

I've looked on forums however don't find any solutions. I found the
ldapjdbc bridge driver from Novell / openLDAP, however it doesn't
support transaction at all cause it wraps a LDAPConnection from JLDAP
which wrap a connection from standard LDAP which doesn't natively
support those transactions.

Another clue is to develop a XAResource by hand, but this seems
overcomplicated.

Does anybody here already have done this stuff ?

Regards,
blured75.
 
R

Raymond DeCampo

Hi,

Do you know if there is any way to use transaction between a RDBMS
backend like Oracle or MySql & an OpenLDAP directory ? Indeed, I've got
a process which make some updates on Database1 then on LDAP then on
Database2. So, if the LDAP update fails then the Database1 data should
be rollbacked. And if the Database2 fails the ldap update should be
rollbacked.

The commit should be done only if DB1, LDAP and DB2 updates are OK. So,
it really looks like 2PC transaction. However, the fact is the
transactions are supported only on RDBMS or JMS queues. The LDAP does
not support transactions of that sort.

I've looked on forums however don't find any solutions. I found the
ldapjdbc bridge driver from Novell / openLDAP, however it doesn't
support transaction at all cause it wraps a LDAPConnection from JLDAP
which wrap a connection from standard LDAP which doesn't natively
support those transactions.

Another clue is to develop a XAResource by hand, but this seems
overcomplicated.

Does anybody here already have done this stuff ?

Unfortunately I think you pretty much have it covered. My impression is
that most LDAP interaction is read-only (at least from a J2EE
application) so I don't think there will be a clamor for this anytime soon.

If you find anything, let us know. It might be a good open source
project to start as well...

Ray
 
7

75blured

I think I found something but it is not really lightwight... However it
seems to work (in theory). I'm just testing it. The idea is to use an
Application Server and use Session Statefull EJB, and implement the
SessionSynchronization interface
(http://jonas.objectweb.org/current/doc/PG_Session.html) which have
hook methods called when the container launch a transaction (prepare),
commit and after commit. In that way it should be possible to use those
methods to implements rollback capability in external DB for example. I
don't really know for the moment which will be the behaviour in
clustered environnement neither with lot of users cause a user using a
Session Statefull = one instance of Session Statefull in memory. If 2
peoples are working on the same data, how will the data consistency be
?

see you.

blured75.
 
S

slippymississippi

http://swik.net/penrose

Penrose (currently at revision 0.9) sits on top of ApacheDS (also
currently at revision 0.9). ApacheDS offers the LDAP interface,
Penrose server connects it to your database.
 
Joined
May 13, 2009
Messages
1
Reaction score
0
Solution

You have to update first the RDBMS in a distributed Transaction (XA-Adapter) and as last System LDAP. when an update on a RDBMS-System fails, the LDAP will not be updated. When LDAP fails, the commit of the UserTransaction will not be done (rollback on the tx-Transaction).

Simple rule:
One system without XA-Support is possible but has always be updated as last system. If you want make more than 1 update on LDAP, there is no good solution. LDAP normally doesn't support transactions at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top