//TODO PRECISA DE CHAMAR UM SERVICO EM VEZ DE SER ASSIM porque esta a abrir transacoes por todo lado //PRECISA DE SE FAZER UM CHECK A TODO O CODIGO QUE ABRE TRANSACOES FORA DOS SERVICOS /**
* @author Jorge Machado
* @date 28/Fev/2008
* @time 2:51:06
* @see pt.estgp.estgweb.domain.dao.impl
*/ publicclass ConfigurationDaoImpl extends ConfigurationDao { publicstatic ConfigurationDaoImpl getInstance() { if(myInstance == null)
myInstance = new ConfigurationDaoImpl(); return(ConfigurationDaoImpl) myInstance; }
/**
* This method only creates transaction if not already active
* @return
*/ publicint getNationalInstitutionCodeCreateTransaction() { //boolean alreadyActive = getCurrentSession().getTransaction().isActive(); //if(!alreadyActive)
getCurrentSession().beginTransaction(); int code = getNationalInstitutionCode(); //if(!alreadyActive)
getCurrentSession().getTransaction().commit(); return code; }
/**
* Not problematic update only for interfaces
* Will not work only in MultiWebServer environment
* in that case needs a restart
* @param instCode
*/ publicvoid updateNationalInstitutionCode(int instCode) { 1.5.0/docs/api/javax/security/auth/login/Configuration.html">Configuration config = load();
config.setNationalInstitutionCode(instCode); //Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode); }
/**
* Not problematic update only for interfaces
* Will not work only in MultiWebServer environment
* in that case needs a restart
* @param instCode
*/ publicvoid updateNationalInstitutionCodeCreateTransaction(int instCode) {
getCurrentSession().beginTransaction();
updateNationalInstitutionCode(instCode); //Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
getCurrentSession().getTransaction().commit(); }