diff --git a/src/NServiceBus.NHibernate/Deduplication/GatewayDeduplication.cs b/src/NServiceBus.NHibernate/Deduplication/GatewayDeduplication.cs index c329ee9f8..dd2b3887f 100644 --- a/src/NServiceBus.NHibernate/Deduplication/GatewayDeduplication.cs +++ b/src/NServiceBus.NHibernate/Deduplication/GatewayDeduplication.cs @@ -46,15 +46,21 @@ await session.SaveAsync(gatewayMessage) await tx.CommitAsync() .ConfigureAwait(false); } - catch (GenericADOException) + catch (ConstraintViolationException) { await tx.RollbackAsync() .ConfigureAwait(false); return false; } + catch (ADOException) + { + await tx.RollbackAsync() + .ConfigureAwait(false); + throw; + } } return true; } } -} \ No newline at end of file +}