Replacing IList with ISet when upgrading Nhibernate
up vote
-1
down vote
favorite
I am working on a web project using MVC 3 and NHibernate 3. When we are trying to upgrade it to NHibernate 4, we got an exception “Cannot simultaneously fetch multiple bags”.
After some research, we have found two main different strategies to fix the problem. One is to replace IList with ISet (refer to here). The other is to use the Future strategy (refer to here).
Some of my team members prefer the first approach to replacing Lists with Sets as in addition to fixing the exception, it can bring performance benefits(refer to here).
However, other team members prefer the Future strategy due to the following reasons:
- IList is used everywhere in our project while ISet is not utilized at
all. Therefore, if we replace IList with ISet, we have to modify
models, viewModels, converters, unit tests and integration tests,
which will involve a lot of efforts. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.
If it does have good reasons to use Sets instead of Lists, we can do this later as a separate task after finishing upgrading
NHibernate, which is more manageable due to the complexity of our
project.
Any suggestions on this? Thanks a lot in advance.
nhibernate
add a comment |
up vote
-1
down vote
favorite
I am working on a web project using MVC 3 and NHibernate 3. When we are trying to upgrade it to NHibernate 4, we got an exception “Cannot simultaneously fetch multiple bags”.
After some research, we have found two main different strategies to fix the problem. One is to replace IList with ISet (refer to here). The other is to use the Future strategy (refer to here).
Some of my team members prefer the first approach to replacing Lists with Sets as in addition to fixing the exception, it can bring performance benefits(refer to here).
However, other team members prefer the Future strategy due to the following reasons:
- IList is used everywhere in our project while ISet is not utilized at
all. Therefore, if we replace IList with ISet, we have to modify
models, viewModels, converters, unit tests and integration tests,
which will involve a lot of efforts. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.
If it does have good reasons to use Sets instead of Lists, we can do this later as a separate task after finishing upgrading
NHibernate, which is more manageable due to the complexity of our
project.
Any suggestions on this? Thanks a lot in advance.
nhibernate
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I am working on a web project using MVC 3 and NHibernate 3. When we are trying to upgrade it to NHibernate 4, we got an exception “Cannot simultaneously fetch multiple bags”.
After some research, we have found two main different strategies to fix the problem. One is to replace IList with ISet (refer to here). The other is to use the Future strategy (refer to here).
Some of my team members prefer the first approach to replacing Lists with Sets as in addition to fixing the exception, it can bring performance benefits(refer to here).
However, other team members prefer the Future strategy due to the following reasons:
- IList is used everywhere in our project while ISet is not utilized at
all. Therefore, if we replace IList with ISet, we have to modify
models, viewModels, converters, unit tests and integration tests,
which will involve a lot of efforts. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.
If it does have good reasons to use Sets instead of Lists, we can do this later as a separate task after finishing upgrading
NHibernate, which is more manageable due to the complexity of our
project.
Any suggestions on this? Thanks a lot in advance.
nhibernate
I am working on a web project using MVC 3 and NHibernate 3. When we are trying to upgrade it to NHibernate 4, we got an exception “Cannot simultaneously fetch multiple bags”.
After some research, we have found two main different strategies to fix the problem. One is to replace IList with ISet (refer to here). The other is to use the Future strategy (refer to here).
Some of my team members prefer the first approach to replacing Lists with Sets as in addition to fixing the exception, it can bring performance benefits(refer to here).
However, other team members prefer the Future strategy due to the following reasons:
- IList is used everywhere in our project while ISet is not utilized at
all. Therefore, if we replace IList with ISet, we have to modify
models, viewModels, converters, unit tests and integration tests,
which will involve a lot of efforts. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.
If it does have good reasons to use Sets instead of Lists, we can do this later as a separate task after finishing upgrading
NHibernate, which is more manageable due to the complexity of our
project.
Any suggestions on this? Thanks a lot in advance.
nhibernate
nhibernate
edited Nov 5 at 23:36
asked Nov 5 at 2:06
Ping
923
923
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41
add a comment |
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147406%2freplacing-ilist-with-iset-when-upgrading-nhibernate%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
One thing to bear in mind is that. IIRC, a set will not allow duplicates, whereas a list would.
– David Osborne
Nov 5 at 9:01
Thanks, David. In our project, duplicates are not allowed in data models. Therefore, it is safe to replace all Lists with Sets.
– Ping
Nov 5 at 23:41