I am not familiar with MySql increment, but the more recommendeds POID generators are HiLo and GUID or guid.comb. Oracle sequences and the hilo sequences work very well but if you are going to use something db-specific, i recommend you to use "native" in mappings and if needed provide a custom dialect overriding the native property. Identity is discourage because it breaks the unit of work pattern (Fabio has a post about this). Assigned is discourage as a POID strategy, and in general PK with domain meaning. Use natural-id if you need a user entered-id.
2011/2/14, Elmer <[email protected]>: > Hello nhusers, > > I am really new to NHibernate and have started learning it a few days > ago. > > I would like to know what kind of generator (hilo, guid, sequence, > increment and many more) should I use if I will be using NHibernate in > traditional client-server applications. I am referring to CRUD type > applications where it can involve one or many more users. > > I am currently reading the book "NHibernate 3.0 Cookbook" by Jason > Dentler and he says that > "counter" and" increment" are "not appropriate for shared-database > scenarios". I am currently using the "increment" generator since I am > using MySQL and want to retrieve the auto-generated primary key > columns in the table where I am inserting. > > What do you think is the generator to choose if you have a 1 - 5 users > that will use these technologies: > 1) WinForms (yes, I am still using it) and MySQL > 2) WebForms and MySQL > > > I hope anyone can enlighten me. > > Thanks! > > -- > 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. > > -- Enviado desde mi dispositivo móvil -- 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.
