package com.arrebol.taxiservicios.controller.connection;

import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author Picasso
 */
public class ConnectionManager {

    /**
     *
     * @param session
     */
    protected void closeSession(Session session) {
        if (null != session) {
            session.close();
        }
    }

    /**
     *
     * @param transaction
     */
    protected void rollback(Transaction transaction) {
        if (null != transaction) {
            transaction.rollback();
        }
    }
    
    /**
     *
     * @param transaction
     */
    protected void commit(Transaction transaction) {
        if (null != transaction) {
            transaction.commit();
        }
    }

    public static final String USER_ID_MANAGER_APPLICATION = "User-Id-Manager-Application";
}
