LLBLGen 4.2, Adapter, SQL Server
With 4.2, the concept of an Allowed Action was introduced. I recently ran into a problem where I was trying to update an entity that was based on a SQL Server View. When I called adapter.SaveEntity(), I got no error, but the changes were not sent to the database. I had no idea why. I had to build a debug version of the LLBLGen and step though the code before I could determine the source of the problem.
Once I knew what the problem was, it was a simple matter to go into the designer and adjust the Allowed Actions to allow updates. The problem was the time it took to figure this out.
It would be my first preference that if I tried to save an entity and that save failed due to the action not being allowed, then I should get an Exception thrown. That way I would very quickly be able to discover my error and fix the situation.
If you can't change things to throw an Exception, then at least I would suggest that you adjust the logging to explain what has happened. I did turn on logging while I was trying to figure this problem out, but it doesn't mention anything about why the entity didn't save:
Method Enter: DataAccessAdapterBase.SaveEntity(4)
Active Entity Description:
Entity: Auctionpay.Aesop.AdapterData.EntityClasses.SaleElementViewEntity. ObjectID: 555e08ac-5a89-4a1e-85af-b0b7c8874f1e
PrimaryKey field: SaleElementId. Type: System.Int32. Value: 1506
Method Enter: DataAccessAdapterBase.PersistQueue
Persistence action info: Action: Insert. Queue length: 0
PersistQueue method result: queuePersisted result: True
Method Exit: DataAccessAdapterBase.PersistQueue
Method Enter: DataAccessAdapterBase.PersistQueue
Persistence action info: Action: Update. Queue length: 1
Current persisted entity info:
Entity: Auctionpay.Aesop.AdapterData.EntityClasses.SaleElementViewEntity. ObjectID: 555e08ac-5a89-4a1e-85af-b0b7c8874f1e
PrimaryKey field: SaleElementId. Type: System.Int32. Value: 1506
PersistQueue method result: queuePersisted result: True
Method Exit: DataAccessAdapterBase.PersistQueue
Method Exit: DataAccessAdapterBase.SaveEntity(4)
Thanks,
Wesley