aspose file tools*
The moose likes JDBC and the fly likes Transaction management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Transaction management" Watch "Transaction management" New topic
Author

Transaction management

Raj Joe
Ranch Hand

Joined: Oct 15, 2004
Posts: 41
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

Joined: Aug 15, 2004
Posts: 2874
yeah, if LDAP insert failed.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30762
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Transaction management