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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Transaction management" Watch "Transaction management" New topic

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.

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

Joined: May 26, 2003
Posts: 31062

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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Transaction management