I'm working on an MVC/NHibernate/SQL application where I need to insert multiple rows (generated dynamically) into the same table while giving them the same group id. Let's say I have the table with
fields(id[Identity], date, amount, group_Id)
How do I figure out a group_id to identify group entries?
As I understand, querying the max group id wouldn't be the solution as many users might access the application at the same time thus generate the same group id. What would be the best way to do it?