Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction management

 
Raj Joe
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a scenerio as below

I have two data stores one is SQL Server and other LDAP.
When I insert a record in SQL Server and should also insert into LDAP.

Steps
I am calling a stored procedure to insert into SQL Server database
After that I call LDAP API to insert into LDAP
I should roll back SQL server insert??
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, if LDAP insert failed.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj,
As LDAP is a database, you should be able to use an XA driver and 2 phase commit to avoid having to do this explicitly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic