當前位置: 首頁>>代碼示例>>Java>>正文


Java Isolation.READ_UNCOMMITTED屬性代碼示例

本文整理匯總了Java中org.springframework.transaction.annotation.Isolation.READ_UNCOMMITTED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Isolation.READ_UNCOMMITTED屬性的具體用法?Java Isolation.READ_UNCOMMITTED怎麽用?Java Isolation.READ_UNCOMMITTED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.springframework.transaction.annotation.Isolation的用法示例。


在下文中一共展示了Isolation.READ_UNCOMMITTED屬性的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: countListaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public Long countListaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao) {
	
	StringBuffer buffer = new StringBuffer();
	
	buffer.append("Select count(p) from PedValidacaoVO p where p.clienteFk.idCliente = :idCliente ");
	
	// verifica se � necess�rio pesquisar por data
	if(pesquisaPedidoValidacao.getDataInicioSolicitacao() != null && pesquisaPedidoValidacao.getDataFimSolicitacao() != null) {
		buffer.append("and p.dataSolicitacao between :dataInicio and :dataFim ");
	}

	Query query = getEntityManager().createQuery(buffer.toString());

	query.setParameter("idCliente", pesquisaPedidoValidacao.getPedidoValidacao().getClienteFk().getIdCliente());
	
	// verifica se � necess�rio pesquisar por data
	if(pesquisaPedidoValidacao.getDataInicioSolicitacao() != null && pesquisaPedidoValidacao.getDataFimSolicitacao() != null) {
		query.setParameter("dataInicio", pesquisaPedidoValidacao.getDataInicioSolicitacao());
		query.setParameter("dataFim", pesquisaPedidoValidacao.getDataFimSolicitacao());
	}

	return (Long)query.getSingleResult();
}
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:24,代碼來源:PedValidacaoHibernateDAO.java

示例2: rememberMeLogin

/**
 * http://jaspan.com/improved_persistent_login_cookie_best_practice
 */
@Override
@Transactional(isolation=Isolation.READ_UNCOMMITTED, rollbackFor=StaleStateException.class)
public Login rememberMeLogin(String token, String series, String ip) {
    Login existingLogin = getDao().getLoginFromAuthToken(token, series);
    if (existingLogin == null) {
        Login loginBySeries = getDao().getByPropertyValue(Login.class, "series", series);
        // if a login series exists, assume the previous token was stolen, so deleting all persistent logins
        // an exception is a request made within a few seconds from the last login time
        // which may mean request from the same browser that is not yet aware of the renewed cookie
        if (loginBySeries != null && new Period(loginBySeries.getLastLoginTime(), new DateTime()).getSeconds() < 5) {
            log.info("Assuming login cookies theft; deleting all sessions for user " + loginBySeries.getUser());
            getDao().deleteLogins(loginBySeries.getUser().getId());
        } else if (log.isDebugEnabled()) {
            log.debug("No existing login found for token=" + token + ", series=" + series);
        }
        return null;
    }
    if (log.isDebugEnabled()) {
        log.debug("Existing login found for token=" + token + " and series=" + series);
    }

    Login newLogin = createLoginAndUpdateUserData(existingLogin.getUser(), existingLogin.getSeries(), true, ip);
    delete(existingLogin);
    return newLogin;
}
 
開發者ID:Glamdring,項目名稱:welshare,代碼行數:28,代碼來源:UserServiceImpl.java

示例3: insert

@Transactional(propagation = Propagation.REQUIRED , isolation = Isolation.READ_UNCOMMITTED)
public void insert(){
	System.out.println(TransactionSynchronizationManager.getCurrentTransactionIsolationLevel());
	System.out.println(">>>>>" + TransactionCacheContextHolder.getContext());
	Test test = new Test();
	test.setA(new Random().nextInt());
	sqlMapper.insert(test);
	service2.insert();
	throw new RuntimeException();
}
 
開發者ID:yaoakeji,項目名稱:hibatis,代碼行數:10,代碼來源:Service1.java

示例4: insert

@Transactional(propagation = Propagation.NOT_SUPPORTED , isolation = Isolation.READ_UNCOMMITTED )
public void insert(){
	System.out.println(TransactionSynchronizationManager.getCurrentTransactionIsolationLevel());
	System.out.println(">>>>>" + TransactionCacheContextHolder.getContext());
	Test test = new Test();
	test.setA(new Random().nextInt());
	sqlMapper.insert(test);
}
 
開發者ID:yaoakeji,項目名稱:hibatis,代碼行數:8,代碼來源:Service2.java

示例5: listaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(ClienteVO cliente);
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:2,代碼來源:IPedValidacaoDAO.java

示例6: listaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(final ClienteVO cliente) {
	
	Query query = getEntityManager().createQuery("Select p from PedValidacaoVO p where p.clienteFk.idCliente = :idCliente order by p.id desc ");

	 
	
	query.setMaxResults(91);
	 
	query.setParameter("idCliente", cliente.getIdCliente());
	
	List<PedValidacaoVO> pedidos = query.getResultList();
	
	 
	
	
	return pedidos;
}
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:18,代碼來源:PedValidacaoHibernateDAO.java

示例7: listaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao, Integer pagina);
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:2,代碼來源:IPedValidacaoDAO.java

示例8: countListaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public Long countListaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao);
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:2,代碼來源:IPedValidacaoDAO.java

示例9: buscarPorId

@Transactional(isolation = Isolation.READ_UNCOMMITTED)
public TpResultVO buscarPorId(Long id) throws PersistenciaException{
	return em.find(TpResultVO.class, id);
}
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:4,代碼來源:TipoResultadoDAOImpl.java

示例10: putWithUnsupportedIsolationLevel

/**
 * @param cache Cache.
 */
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
public void putWithUnsupportedIsolationLevel(IgniteCache<Integer, String> cache) {
    cache.put(1, "1");
}
 
開發者ID:apache,項目名稱:ignite,代碼行數:7,代碼來源:GridSpringTransactionService.java

示例11: listaPedidosValidacaoCliente

@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(final ClienteVO cliente) {
	
	Query query = getEntityManager().createQuery("Select p from PedValidacaoVO p where p.clienteFk.idCliente = :idCliente order by p.id desc ");

	
	
	query.setMaxResults(10);
	 
	query.setParameter("idCliente", cliente.getIdCliente());
	
	List<PedValidacaoVO> pedidos = query.getResultList();
	
	return pedidos;
}
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:15,代碼來源:PedValidacaoHibernateDAO.java

示例12: listaPedidosValidacaoCliente

@SuppressWarnings("unchecked")
@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao, Integer pagina) {
	

	StringBuffer buffer = new StringBuffer();
	
	buffer.append("Select p from PedValidacaoVO p where p.clienteFk.idCliente = :idCliente ");
	
	// verifica se � necess�rio pesquisar por data
	if(pesquisaPedidoValidacao.getDataInicioSolicitacao() != null && pesquisaPedidoValidacao.getDataFimSolicitacao() != null) {
		buffer.append("and p.dataSolicitacao between :dataInicio and :dataFim ");
	}

	buffer.append("order by p.id desc");
	
	Query query = getEntityManager().createQuery(buffer.toString());

	query.setParameter("idCliente", pesquisaPedidoValidacao.getPedidoValidacao().getClienteFk().getIdCliente());
	
	// verifica se � necess�rio pesquisar por data
	if(pesquisaPedidoValidacao.getDataInicioSolicitacao() != null && pesquisaPedidoValidacao.getDataFimSolicitacao() != null) {
		query.setParameter("dataInicio", pesquisaPedidoValidacao.getDataInicioSolicitacao());
		query.setParameter("dataFim", pesquisaPedidoValidacao.getDataFimSolicitacao());
	}
	
	Paginacao paginacao = new Paginacao();
	
	paginacao.setInicio(pagina == null?0:pagina * super.getMaxResult());
	paginacao.setLimite(super.getMaxResult());
	
	addPaginacaoRestriction(query, paginacao);
	
	List<PedValidacaoVO> pedidos = query.getResultList();
	
	return pedidos;
}
 
開發者ID:darciopacifico,項目名稱:omr,代碼行數:37,代碼來源:PedValidacaoHibernateDAO.java


注:本文中的org.springframework.transaction.annotation.Isolation.READ_UNCOMMITTED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。