我正在使用Java,hibernate,SEAM和Richfaces。服務器JBOSS到期時更新數據庫
我在數據庫中保存了一個指示用戶登錄的寄存器,現在我需要在服務器會話過期的時候保存在數據庫中。 我實現了一個實現HttpSessionListener的類。我把方法sessionDestroyed一些像下一個:
...
historia.setFechafinal(new Date());
historia.setGlosa("test");
historia.setTiempo("tiempo");
entityManager.persist(historia);
...
當我想堅持對象historia錯誤拋出。這應該是因爲會話已過期,組件entityManager不存在。
會話過期後,如何在數據庫中寫入數據?我是這個科目的新手。
謝謝你