title: generate unique sequence number and transaction - with Entity framework 4
body: <p>I have a Document Sequence table with 1 row and 1 column. All it does is have a sequence number. Every time we need to create a new document, we call a stored proc which updates the existing sequence number in this table by 1 and read that and use that for id in the document table. </p>
  
  <p>My question is: If multiple requests try to call this stored proc which updates the sequence number and returns it, is there a chance it will give the same number to multiple callers? I right now have another stored proc which calls this seq number generator sp in a transaction and then create a document with the obtained id. I was wondering if I had to do it with just entity framework in code and not use the stored proc, is it possible? Will Entity framework 4 support transaction by itself so that only one process is calling the seq# updater sp at a time? </p>