이 콘텐츠는 선택한 언어로 제공되지 않습니다.
10.3.2. Using a Seam-managed Hibernate session
Seam-managed Hibernate sessions work in a similar fashion. In
components.xml
:
Here,
java:/bookingSessionFactory
is the name of the session factory specified in hibernate.cfg.xml
.
Note
Seam does not synchronize the session with the database, so always enable
hibernate.transaction.flush_before_completion
to ensure that the session is automatically synchronized before the JTA transaction commits.
We can now inject a managed Hibernate
Session
into our JavaBean components with the following code:
@In Session bookingDatabase;
@In Session bookingDatabase;