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:




  1. 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.

  2. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.


  3. 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.










share|improve this question
























  • 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















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:




  1. 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.

  2. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.


  3. 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.










share|improve this question
























  • 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













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:




  1. 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.

  2. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.


  3. 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.










share|improve this question















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:




  1. 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.

  2. There are very few places where the exception is thrown. It seems an easier and simpler job to fix them individually.


  3. 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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




















































































這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini