wolli wrote:
Two things that look strange for me:
1) you never commit your transaction. I don't think that's done automatically, when you close the session.
I'm doing only selects I thought that was not necessary.
wolli wrote:
2) you clear the session in an ongoing transaction and in an ongoing enumeration over the NivelEntities.
This prevent the memory to grow even more.
wolli wrote:
Try to retrieve the NivelEntities in one step with query.List<NivelEntity>(), then clear the session and iterate through the entries. I'm not sure about the transaction, when do you want to commit/rollback ? After each indexWriter.AddDocument() ?
I've tried that, as you can see I still have the list definition :) and I also tried to close the session and open a new one in every iteration, but that gives me an error saying that I cannot access to the NivelEntity's fields in the getDocument method, as it was expected. What make me think that the that is the main session that grows because of that NivelEntity calls. Should I remove that references and get the fields through the session object?