Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26812/NHibernate/Collection
Modified Files:
CollectionPersister.cs
Log Message:
Modified how exceptions are rethrown - NH-153 and this blog
http://dotnetguy.techieswithcats.com/archives/004118.shtml
inspired effort.
Index: CollectionPersister.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** CollectionPersister.cs 28 Aug 2004 15:31:46 -0000 1.28
--- CollectionPersister.cs 30 Nov 2004 18:36:49 -0000 1.29
***************
*** 686,692 ****
session.Batcher.AddToBatch(-1);
}
catch (Exception e)
{
! throw e;
}
if (log.IsDebugEnabled ) log.Debug("done deleting collection");
--- 686,694 ----
session.Batcher.AddToBatch(-1);
}
+ // TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
if (log.IsDebugEnabled ) log.Debug("done deleting collection");
***************
*** 722,728 ****
}
}
catch (Exception e)
{
! throw e;
}
if( log.IsDebugEnabled) log.Debug("done inserting collection");
--- 724,732 ----
}
}
+ //TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
if( log.IsDebugEnabled) log.Debug("done inserting collection");
***************
*** 754,760 ****
}
}
catch (Exception e)
{
! throw e;
}
--- 758,766 ----
}
}
+ // TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
***************
*** 790,796 ****
}
}
catch (Exception e)
{
! throw e;
}
}
--- 796,804 ----
}
}
+ // TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
}
***************
*** 818,825 ****
}
}
catch(Exception e)
{
session.Batcher.AbortBatch( e );
! throw e;
}
--- 826,834 ----
}
}
+ // TODO: change to SqlException
catch(Exception e)
{
session.Batcher.AbortBatch( e );
! throw;
}
***************
*** 846,852 ****
}
}
catch (Exception e)
{
! throw e;
}
}
--- 855,863 ----
}
}
+ //TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
}
***************
*** 898,905 ****
i++;
}
! }
catch (Exception e)
{
! throw e;
}
--- 909,918 ----
i++;
}
! }
! //TODO: change to SqlException
catch (Exception e)
{
! session.Batcher.AbortBatch( e );
! throw;
}
|