In fact, I overloaded the entity.addnew() method.
Code:
Public Overrides Sub AddNew()
MyBase.AddNew()
'I am not looking for composite keys
If Me.Meta.Columns.PrimaryKeys.Count = 1 Then
'Only if the PK has a datatype of Guid
If Me.Meta.Columns.PrimaryKeys.Item(0).Type Is GetType(Guid) Then
Me.SetColumn(Me.Meta.Columns.PrimaryKeys.Item(0).Name, Guid.NewGuid)
End If
End If
End Sub
But since that, I've been having some weird behavior, like inserts that work well but update that don't commit ( exceptions saying that 0 rows were affected instead of 1) or that throw concurrency errors, especially when wrapped in a "using scope as new esTransactionScope" clause and on collection.save(). When replace my saves by sql update queries, everything is runs just fine.
Do you think the overloaded AddNew() method could be the cause of all this? As I said in a previous post, everything was running fine before I changed my identity PK's to UniqueIdentifier's.
It's a bit hard to provide a sample project that reproduces these errors... would it be possible to have entityspaces retrieve the new guid primary key on inserts on the next maintenance release ?
Thanks!
- El pipo -