Mensaje
General information
Foro:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
ID de la conversación:
00811534
ID del mensaje:
00811706
Views:
16
You shouldn't lock a table or record across multiple SQL calls, that was the Foxpro way of assigning PK. My main question here is which method in the framework can I override so I can call a SP instead of using the CommandBuilder to perform the INSERT.

There is another way I can think of which is retrieve the max PK, then attempt the insert with a try catch block, retry the insert with the next number for a number of times. Again, where should I add this code?

Stephen


>How you get at the next primary key is a separate issue from MMF. Some developers us an ID table that contains the next id to use for each table. The table is locked while the next key is extracted to avoid any concurrency issues. If you find the next id from the actual table, you will need to manually deal with concurrency issues.
Stephen Lee

--------------------------------
Too much to code
Too little time
--------------------------------
Previous
Next
Responder
Mapa
Ver