List of usage examples for org.springframework.transaction.annotation Isolation DEFAULT
Isolation DEFAULT
To view the source code for org.springframework.transaction.annotation Isolation DEFAULT.
Click Source Link
From source file:no.dusken.barweb.service.impl.PersonInvoiceServiceImpl.java
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public void savePersonsAndInvoice(List<BarPerson> barPersons, Invoice invoice) { barPersonService.save(barPersons);//from www. j a v a 2 s. c o m invoiceService.save(invoice); }
From source file:no.dusken.barweb.service.impl.InvoiceTransaksjonServiceImpl.java
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public Invoice saveInvoiceAndTransaksjons(Invoice invoice, List<Transaksjon> transaksjons) { // invoice = invoiceService.save(invoice); for (Transaksjon t : transaksjons) { t.setInvoice(invoice);/*ww w. ja v a2 s.c o m*/ } transaksjonService.save(transaksjons); return invoice; }
From source file:no.dusken.barweb.service.impl.BalanceTransaksjonExtendedService.java
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public void saveBalanceTransaksjonAndPerson(BalanceTransaksjon balanceTransaksjon, BarPerson barPerson) { barPersonService.save(barPerson);//from ww w. ja v a 2s . c o m balanceTransactionService.save(balanceTransaksjon); }
From source file:no.dusken.barweb.service.impl.BalanceTransaksjonExtendedService.java
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public boolean deleteTransactionUpdatePerson(BalanceTransaksjon transaksjon, BarPerson barPerson) { try {//ww w .jav a2s . com barPersonService.save(barPerson); transaksjonService.delete(transaksjon); } catch (Exception e) { return false; } return true; }
From source file:no.dusken.barweb.service.impl.InvoiceTransaksjonServiceImpl.java
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public void deleteInvoiceUpdateTransaksjons(Invoice invoice, List<Transaksjon> transaksjons) { for (Transaksjon t : transaksjons) { t.setInvoice(null);/*from w w w . j av a 2 s.co m*/ transaksjonService.save(t); } invoiceService.delete(invoice); }
From source file:com.logicaalternativa.ejemplomock.rest.bussiness.AddCodeBusinessImp.java
@Override @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false, rollbackFor = Throwable.class) public void validateAndAdd(PromotionCode promotionCode) throws ValidationException { validateValuesPromotionCode(promotionCode); getPromotionCodeRepository().saveAndFlush(promotionCode); }
From source file:org.trpr.platform.core.impl.persistence.PersistenceDelegate.java
/** * Persists the specified PersistentEntity using the specified PersistenceProvider. Note that this method is transactional by default. * It is advisable to use {@link PersistenceManagerProvider#makePersistent(PersistentEntity)} instead of calling this method directly. * @param entity the PersistentEntity to persist * @param provider the PersistenceProvider to use in persistence * @return the PersistentEntity that was persisted * @throws PersistenceException in case of persistence errors *///from w w w . j av a 2 s . c o m @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT, rollbackForClassName = { "Exception" }) public PersistentEntity makePersistent(PersistentEntity entity, PersistenceProvider provider) throws PersistenceException { entity = provider.makePersistent(entity); return entity; }
From source file:org.trpr.platform.core.impl.persistence.PersistenceDelegate.java
/** * Deletes the specified PersistentEntity using the specified PersistenceProvider. Note that this method is transactional by default. * It is advisable to use {@link PersistenceManagerProvider#makeTransient(PersistentEntity)} instead of calling this method directly. * @param entity the PersistentEntity to delete * @param provider the PersistenceProvider to use in deletion * @throws PersistenceException in case of deletion errors *///from w w w. j a v a2s. co m @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT, rollbackForClassName = { "Exception" }) public void makeTransient(PersistentEntity entity, PersistenceProvider provider) throws PersistenceException { provider.makeTransient(entity); }
From source file:no.dusken.aranea.service.LoginDetailsServiceImpl.java
/** * Create a new user with the supplied details. * The password should be in plaintext in this object, will be encrypted before persisted. *//*w ww. ja v a 2 s . c om*/ @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public LoginDetails createLoginDetails(LoginDetails user) { String plainText = user.getPassword(); String encrypted = encoder.encodePassword(plainText, user.getUsername()); user.setPassword(encrypted); logger.info("Creating user with username: {}", user.getUsername()); return super.saveOrUpdate(user); }
From source file:org.trpr.platform.core.impl.persistence.PersistenceDelegate.java
/** * Persists the specified PersistentEntity instances using the specified PersistenceProvider instances, matched by index positions. * Note that this method is transactional by default. * It is advisable to use {@link PersistenceManagerProvider#makePersistent(PersistentEntity[])} instead of calling this method directly. * @param entities the PersistentEntity instances to persist * @param providers the PersistenceProvider instances to use in persistence * @return PersistentEntity instances that were persisted * @throws PersistenceException in case of persistence errors *//*from w ww . ja va 2 s .c om*/ @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT, rollbackForClassName = { "Exception" }) public PersistentEntity[] makePersistent(PersistentEntity[] entities, PersistenceProvider[] providers) throws PersistenceException { for (int i = 0; i < entities.length; i++) { providers[i].makePersistent(entities[i]); } return entities; }