• Post Reply Bookmark Topic Watch Topic
  • New Topic

rollback in LDAP

 
varsha rao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Can anyone tell me if we have a rollback option for LDAP operations. my requirement is, whenever a i update a record in my oracle database, i need to migrate it to TDS as well. But if an exception occurs, the rollback should happen in both TDS as well as oracle .

My code outline is like this

Method a()
{
update in oracle
}

method b()
{
update in TDS
}

method c()
{

method a;
method b;

}

but if a NamingException occurs in method b , i have to roll back all the LDAP operations i performed there . Rolling back oracle operations is ok , but how do we roll back the LDAP operations.

Can someone help me with this.

Thanks

Cheers
Varsha
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi varsha,

as far as I know LDAP currently doesn't support transactions! A LDAP server may use transactions internally - depending on the data backend used - but this is used for features like server crash recovery etc. and not for LDAP clients.

Although there are plans to provide transactions mechanisms for clients like RDBMS systems already do these ideas are very new because LDAP was originally designed to support mostly "read" operations. I think it will take some time until transactions will get to the official LDAP specification supported by production LDAP servers.

For the moment you will have to implement the concept of transactions on your own or of course with the help of transaction APIs or the transactions mechanisms of an application server if this is an enterprise application.

By the way, here's a link to a draft for OpenDS. I didn't read it completely but perhaps you'll find some more information on transactions in it.

Marco
 
varsha rao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot Marco . Just one more small help , do you have any code examples where JTA has been implemented. Do we need EJB's for JTA or can we implement it wihtout it.

Cheers
Varsha
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi varsha,

unfortunately I didn't use this one myself before, so I can't give you a helpful example. But I found Atomikos which should help you to use JTA transactions in Java SE applications. It's an opensource implementation of (a subset of) JTA which can be used without EJBs and application servers. Luckily there's a link to a little introduction and on the Atomikos homepage are additional links to documentation. Good luck

Marco
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!