http://stackoverflow.com/questions/5057029/staleobjectstateexception-and-isqlexceptionconverter-problem
I use the version 3.0.0.4000 of NHibernate
When an exception of type "StaleObjectStateException" thrown because
of concurrency checking, it does not catched by the implementation of
the interface "ISQLExceptionConverter".
public class OracleDataClientExceptionConverter :
ISQLExceptionConverter
{
public Exception Convert(AdoExceptionContextInfo exInfo)
{
var sqlException =
ADOExceptionHelper.ExtractDbException(exInfo.SqlException) as
Oracle.DataAccess.Client.OracleException;
if (sqlException != null)
{
switch (sqlException.Number)
{
case 1:
return new
ConstraintViolationException("duplication of data", null, "Unique
Constratint");
case 3960:
return new
StaleObjectStateException(exInfo.EntityName, exInfo.EntityId);
}
}
return
SQLStateConverter.HandledNonSpecificException(exInfo.SqlException,
exInfo.Message, exInfo.Sql);
}
}
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.