none
illegal attempt to associate a collection with two open sessions hibernate

    Question

  • Hi All,

    Any help with this would be much appreciated. My project can run properly on  Window 2003 server, Xp server and other server.

    When I attempt to run my project on window server 2008 (64 bit), I got the error " illegal attempt to associate a collection with two open sessions hibernate"

    I think it is the configuration issue at web.config.

    But I can't figure out how to solve it.

    The following is the event which makes the error.

     

    public string AllocateSSCCNumberRangeAndGenerateItems(int count, double palletQuantity, string userLogin)
            {
                TransactionBase tx = Session.BeginTransaction();
                try
                {
                    IList<string> ssccs = AllocateSSCCNumbers(count, WorkOrder.Id, Line.Id, true);
                    GenerateItems(ssccs, true, palletQuantity, userLogin);
                    tx.Commit();
                    Session.Current.Flush();
                    Session.Current.Refresh(this._PrintRun);
                    return ssccs[0];
                }
                catch
                {
                    tx.Rollback();
                    throw;
                }
            }

     

    Any more details would be appreciated.

     

    Thanks and Best Regards

    Su Hlaing

    Monday, December 20, 2010 3:24 AM

Answers

  • Hi,

     

    How about running the project in Windows Server 2003 compatibility mode? Right click the project, click Properties, click Compatibility tab, select “Windows Server 2003 (Service Pack 1)”, click OK.

     

    BTW, I noticed that you’re a developer, please post in MSDN forums so that you can get a better assistance on analyzing the source code.

     

    Best Regards

    Dale


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Monday, December 20, 2010 6:54 AM
    Moderator

All replies

  • Hi,

     

    How about running the project in Windows Server 2003 compatibility mode? Right click the project, click Properties, click Compatibility tab, select “Windows Server 2003 (Service Pack 1)”, click OK.

     

    BTW, I noticed that you’re a developer, please post in MSDN forums so that you can get a better assistance on analyzing the source code.

     

    Best Regards

    Dale


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Monday, December 20, 2010 6:54 AM
    Moderator
  • Hi Dale,

    Thanks for your reply. I try in Window Server 2003(Compatibility mode.  I already raised the questions to MSDN forums and Asp.net forum. But I haven't got how to solve this porblem.

     

     

     

    Thanks & Best Regards

    Su Hlaing

    Monday, December 20, 2010 6:57 AM
  • As a work around, maybe you can install a Virtual Machine on Windows Server 2008, then run this program in Virtual Machine.  Maybe other community users who is familiar with writing code can propose other suggestions. Good luck!

    Best Regards

    Dale


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Monday, December 20, 2010 7:47 AM
    Moderator
  • Hi Dale,

    I already installed Virtual Machine on Window Server 008 and trace the program. The problem come out when the method is executed to load the data from DB by using NHibernate mapping. I already checked web.config , Global.asax and other IIS 7 setting . But I haven't solved this issue. It already took so many times.

    I hope any help to solve this issue.

     

     

    Thanks and Regards

    Su Hlaing

     

     

     

    Friday, December 24, 2010 1:45 AM
  • Hi Su Hlaing, do you resolved these?

    MPAZ
    Thursday, November 10, 2011 5:37 PM