-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: wrong exception translation
PostPosted: Wed Jun 22, 2011 10:01 pm 
Newbie

Joined: Fri Feb 18, 2011 12:25 am
Posts: 8
Hello!

I am using Spring.Net 1.3.1 with NHibernate 3.0 and have a strange problem regarding exception translation if a unique key violation (on SQL Server/SQL Express) occurs.
If an entity (f.e. Product) is updated via CurrentSession.SaveOrUpdate in the DAOs MakePersistent and a unique key violation (f.e. Product.Name) occurs the SqlException with code 2627 is correctly translated to an DataIntegrityViolationException.
But if the same MakePersistent is called for a new entity and an SqlException with code 2627 is thrown (Product with same name already exists) then the exception is translated to an UncategorizedAdoException! I would expect/need an DataIntegrityViolationException (even better a DuplicateKeyException) here too.

I would appreciate any ideas/solutions on this problem.

Regards

_________________
christian louboutin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.