Duvidas Spring

1 resposta
Deluxe

Pessoal
estou iniciando um projeto web
e estou querendo colocar o Spring
mais to com algumas duvidas

quando eu fasso essa transação

public PK save(Tipo novoObj) throws PersistenceException {
		try {
			return (PK) getHibernateTemplate().save(novoObj);
		} catch (Exception e) {
			logger.error("Error:",e);
			throw new PersistenceException(e);
		}	
	}

O spring abre uma conexão, faz o commit e fecha a conexao?

me falaram que não, ou vc pode fazer na mão, ou configurar isso

essa configuração seria isso?

<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transactionAttributes">
            <props>
            	<prop key="add*">PROPAGATION_REQUIRED </prop>
        		<prop key="delete*">PROPAGATION_REQUIRED </prop>
       	 		<prop key="update*">PROPAGATION_REQUIRED </prop>
        		<prop key="save*">PROPAGATION_REQUIRED </prop>
       			<prop key="get*">PROPAGATION_REQUIRED,readOnly </prop> 
            </props>
        </property>
       
    </bean>

alguem pode me explicar esses trechos??

obrigado

1 Resposta

Deluxe

ninguem trabalha com spring?
tnks

Criado 24 de agosto de 2009
Ultima resposta 24 de ago. de 2009
Respostas 1
Participantes 1