本文整理匯總了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();
}
示例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;
}
示例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();
}
示例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);
}
示例5: listaPedidosValidacaoCliente
@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(ClienteVO cliente);
示例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;
}
示例7: listaPedidosValidacaoCliente
@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public List<PedValidacaoVO> listaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao, Integer pagina);
示例8: countListaPedidosValidacaoCliente
@Transactional(isolation=Isolation.READ_UNCOMMITTED,readOnly=true)
public Long countListaPedidosValidacaoCliente(PesquisaPedidoValidacao pesquisaPedidoValidacao);
示例9: buscarPorId
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
public TpResultVO buscarPorId(Long id) throws PersistenciaException{
return em.find(TpResultVO.class, id);
}
示例10: putWithUnsupportedIsolationLevel
/**
* @param cache Cache.
*/
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
public void putWithUnsupportedIsolationLevel(IgniteCache<Integer, String> cache) {
cache.put(1, "1");
}
示例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;
}
示例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;
}