I forgot to say: the injected EntityManager is always null. I think it happens because the Seam session is already dead... But I'd like to find a good way to update the database on session expires. Thanks!
You can create a Session scoped component and add the method annotated with @Destroy. In this method you can release your session-related objects(or whatever you need to do). This method will be invoked before your session is destroyed.
with best regards,
Yeah, it should really works! thanks a lot Dima!