DLinq: IDENTITY and TIMESTAMP columns with INSERT stored procedures
Without an [InsertMethod] specified DLinq creates an INSERT statement that does the insertion and selects the IDENTITY field (and timestamp column, if specified).
With an [InsertMethod] returned values do not seem to be being read back into the object even if returned by the stored procedure. I've tried returning just Id and timestamp (as per DLinq-generated statements) and returning whole row.
Does DLinq try to read values returned from Insert/Update procedures?
Thanks.
As far as I can tell, there is no way to get at the values returned by an INSERT procedure. If this is so, I cannot see how INSERT stored procedures can work with IDENTITY columns in DLinq. I also cannot see how the current implementation can support an optimistic concurrency implementation with stored procedures.
You would need to do it the same way that DLINQ does it.
insert into table(a,b,c) values(1,2,3)
select @@Identity
This inserts the data and returns a rowset that contains the newly created identity.
Any chance of adding a feature request to provide a mechanism for DLinq to do the reading back of values returned from [InsertMethod]s and [UpdateMethod]s? Without it, working with stored procedures will be nearly as onerous as writing your own Data Mappers.
One could even imagine a feature where as long as the stored procedures follow a @ColumnName naming convention and return AutoGen and IsVersion columns then all we would need to do is give DLinq the procedure name.
Wishful thinking, perhaps...
Thanks.
omg, I certainly hope they'll support reading parameter values on the InsertMethod and UpdateMethods
You should submit a product feedback (if that's still going) re dlinq.