views:

59

answers:

1

While there's lots to like about DataObjects.NET, I've found help resources to be a lean, and can't find a solit example of using DataObjects.NET with RDBMS generated primary keys. It would seem as though D4O won't do inserts against SQL Server unless it's in controll of the key.

Has anyone solved this in the wild?

+2  A: 

There is no easy way to make DO4 use IDENTITY columns - mainly, because it is designed to rely on bulk key generation (aka HiLo algorithm).

AFAIK, there are no good workarounds here. E.g. DO4 supports custom key generators, but it's pretty complex to develop one relying on IDENTITY column - in fact, it should insert fake records in bulks and remove them further (or rollback a transaction) to work. Taking into account there can be columns with unique constraints, the task becomes pretty complex.

We'll think about implementing this in future.

Alex Yakunin
P.S. I just read the same question in our support mail list. So I'll send the link to this question in reply.
Alex Yakunin
OT Alex , can I go to the database and delete an object manually and then in my grid that that object should not appear?
abmv
Surely - DO doesn't require all the operations to pass through it.
Alex Yakunin