Hello,
I'm currently working on a client / server project in .Net, and we need to make sure that each client application will use 1 and only 1 connection to the database.
Unfortunately, we saw recently that when a new object need to be inserted into the database, an extra database connection is created by Nhibernate. With deeper investigations, it seems that it happens when NHibernate generate the object key, which is configured to use the hilo algorithm.
My questions are :
- can I force NHibernate to use only one single connection, without changing the generator algorithm ? (with a kind of session factory parameter maybe ?)
- if no, and if I change the generator algorithm, can I avoid this extra connection to be created, or are there other cases where connections will be created anyway ?
Until now I've not been able to find documentation on that topic. I hope somebody can help me on this one.
Thanks !
|