Hey All !
Just a newbie question:
Under what cirumstances does adapter.SaveEntity(entity,true) return false??
The case is that it returns false but everything seems to be allright with inserted/updated rows in the DB and no exception is thrown.
I am using Firebird / Firebird.net 1.7A
my code looks like this:
(please let me know I you find any WTFs! ;-)
'preprocess entity before saving to Database
If (entity.IsDirty And Not entity.IsNew) Then
'(AUDIT) write changes and original values to a XML Document
entity.WriteXml(XmlFormatAspect.DatesInXmlDataType, xmldoc)
End If
If(adapter.SaveEntity(entity, True)) Then
'Write success message to Logfile
WriteLog(Me.UMO001NR, Me.CODE, TranslationManager.GetLocalErrorMessageString("SAVEUMO211SUCCESS",Me.Language), Nothing, Me.SessionID, xmldoc)
Return True
Else
Return False
End If
Catch eORM As ORMQueryExecutionException
'Write Exception to logfile
WriteLog(Me.UMO001NR, Me.CODE, TranslationManager.GetLocalErrorMessageString("SAVEUMO211ERROR",Me.Language), eORM.Message, Me.SessionID, xmldoc)
Return False
Catch ex As Exception
'Write Exception to logfile
WriteLog(Me.UMO001NR, Me.CODE, TranslationManager.GetLocalErrorMessageString("SAVEUMO211ERROR",Me.Language), ex.Message, Me.SessionID, xmldoc)
Return False
Finally
adapter.CloseConnection()
adapter.Dispose()
End Try