Hibernate Session Problemi: Illegal attempt to associate a collection with two open sessions
BTSoru.com projesini modellerken aşağıdaki hata ile karşılaştım: org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions at bt.btsoru.application.manager.question.facade.QuestionManagerImpl.addQuestion(QuestionManagerImpl.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) Hatanın oluşmasını sağlayan kod bölümü şu şekilde: [source language=’java’] // Soruyu ekleme bölümü BTUser user = new BTUser(); user.setId(WebSession.get().getUser().getId()); getQuestion().setUser(WebSession.get().getUser()); QuestionManagerResult result = qManager.addQuestion(getQuestion()); [/source] Kod 1.1 Birinci satırda yer […]