All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dream.drive.holder.DriveSessionHolder Maven / Gradle / Ivy

package com.dream.drive.holder;

import com.dream.drive.transaction.TransManager;
import com.dream.system.core.session.Session;
import com.dream.system.core.session.SessionFactory;
import com.dream.template.session.SessionHolder;

public class DriveSessionHolder implements SessionHolder {
    private SessionFactory sessionFactory;

    public DriveSessionHolder(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    @Override
    public Session getSession() {
        return sessionFactory.openSession(false);
    }

    @Override
    public void closeSession(Session session) {
        session.close();
    }

    @Override
    public boolean isSessionTransactional(Session session) {
        return TransManager.isTrans();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy