Hi Fabio - thank you for your reply. Alas, I do not see the solution, that you are seeing. :-)
A little bit more detail: The Product table is mapped to a domain object using NHibernate. When I have to create new instances I create new Product instance I add them to a ProductList property of a Supplier object, and then I use cascading persistence to have the Products inserted in the database. Cheers, Thomas On 19 Apr., 21:21, Fabio Maulo <[email protected]> wrote: > re-read your first phrase... than think about where put that thing ;) > > 2009/4/19 Thomas Koch <[email protected]> > > > > > > > > > Hi - I am working on a legacy database, moving business logic from SP > > to domain objects relying NHibernate. > > > I have encountered the following in a SP used to insert a "Product" > > row: > > > DECLARE @productNumber int > > SET @productNumber = (SELECT isnull(MAX(ProductNumber), 401100) +1 > > FROM Product) > > > INSERT INTO Product ( > > .... [ProductNumber] ... > > ) > > VALUES ( > > .... @productNumber > > ) > > > I do not think its pretty, but is there anyway I can reproduce this > > with NH ? > > > I am not even sure the existing solution does not contain a race > > condition. > > > Cheers, > > Thomas > > -- > Fabio Maulo- Skjul tekst i anførselstegn - > > - Vis tekst i anførselstegn - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
