01: package org.concern.controller;
02:
03: import org.hibernate.Session;
04: import org.hibernate.SessionFactory;
05:
06: import javax.transaction.*;
07:
08: public class JTASessions implements Sessions {
09: private SessionFactory sessionFactory;
10:
11: public void setTransactionManager(
12: TransactionManager transactionManager) {
13: }
14:
15: public SessionFactory getSessionFactory() {
16: return sessionFactory;
17: }
18:
19: public void setSessionFactory(SessionFactory sessionFactory) {
20: this .sessionFactory = sessionFactory;
21: }
22:
23: public synchronized Session getSession() {
24: return sessionFactory.getCurrentSession();
25: }
26: }
|