Transactions should work. Wrap all of the inserts in a single transaction, including the one that returns the identity column.
No, the exception will not be wiped out. I created a console application as follows to test it: using System; namespace ConsoleApplication1 { class Program { static void Main(string args) { Program p = new Program(); try { p.MainMethod(); } catch (Exception ex) { Console. WriteLine("=== Insert Exception ==="); Console.
WriteLine(ex.ToString()); Console.WriteLine(); } Console.ReadLine(); } public void MainMethod() { int identity = 0; try { identity = DoFirstInsert(); DoSubsequentInsert(identity); } catch { RollbackStuff(identity); throw; } } private void RollbackStuff(int identity) { try { throw new Exception("Exception on rollback"); } catch (Exception ex) { Console. WriteLine("=== Rollback Exception==="); Console. WriteLine(ex.ToString()); Console.WriteLine(); } } private void DoSubsequentInsert(int identity) { throw new Exception("Exception on insert"); } private int DoFirstInsert() { return 1; } } }.
Although this answers your question about exceptions, John Saunder's answer about Transactions is definitely the best way to go to manage rollbacks. – Malcolm Jul 27 '09 at 15:38.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.