Java Code Examples for org.springframework.transaction.annotation.Propagation#MANDATORY
The following examples show how to use
org.springframework.transaction.annotation.Propagation#MANDATORY .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PersonService.java From tutorial with MIT License | 5 votes |
/** * Propagation.MANDATORY 必须在一个已有的事务中执行,否则抛出异常 */ @Transactional(propagation=Propagation.MANDATORY) public void insertMandatory(PersonDto person, boolean throwException) { personDao.insert(person); if(throwException) { throw new RuntimeException("ERROR"); } }
Example 2
Source File: TransactionUtilImpl.java From training with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void executeWith_MANDATORY(Runnable runnable) { runnable.run(); }
Example 3
Source File: RdbmsGenericDao.java From devicehive-java-server with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY) public long count(CriteriaQuery<Long> cq) { return em.createQuery(cq).getSingleResult(); }
Example 4
Source File: RdbmsGenericDao.java From devicehive-java-server with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY) public <T extends Serializable> void remove(T entity) { em.remove(entity); }
Example 5
Source File: RdbmsGenericDao.java From devicehive-java-server with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY) public <T extends Serializable> T merge(T entity) { return em.merge(entity); }
Example 6
Source File: RdbmsGenericDao.java From devicehive-java-server with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY) public <T extends Serializable> void persist( T entity ){ em.persist(entity); }
Example 7
Source File: FooTransactionalUnitTest.java From tutorials with MIT License | 4 votes |
@Transactional(propagation = Propagation.MANDATORY) public Foo identity(Foo entity) { return entity; }
Example 8
Source File: FooTransactionalUnitTest.java From tutorials with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public Foo create(Foo entity) { return super.create(entity); }
Example 9
Source File: UserInnerService.java From replication-datasource with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY, readOnly = true) public User findByUserIdWithPropagationMandatory(Integer id) { return userRepository.findById(id); }
Example 10
Source File: GridSpringTransactionService.java From ignite with Apache License 2.0 | 4 votes |
/** * @param cache Cache. */ @Transactional(propagation = Propagation.MANDATORY) public void putWithMandatoryPropagation(IgniteCache<Integer, String> cache) { cache.put(1, "1"); }
Example 11
Source File: TransactionUtilImpl.java From training with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void executeWith_MANDATORY(Runnable runnable) { runnable.run(); }
Example 12
Source File: UserInnerService.java From replication-datasource with Apache License 2.0 | 4 votes |
@Transactional(propagation = Propagation.MANDATORY, readOnly = true) public User findByUserIdWithPropagationMandatory(Integer id) { return userRepository.findById(id); }
Example 13
Source File: User1ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatoryException(User1 user){ user1Mapper.insert(user); throw new RuntimeException(); }
Example 14
Source File: User1ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatory(User1 user){ user1Mapper.insert(user); }
Example 15
Source File: User2ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatoryException(User2 user){ user2Mapper.insert(user); throw new RuntimeException(); }
Example 16
Source File: User2ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatory(User2 user){ user2Mapper.insert(user); }
Example 17
Source File: User1ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatoryException(User1 user){ user1Mapper.insert(user); throw new RuntimeException(); }
Example 18
Source File: User1ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatory(User1 user){ user1Mapper.insert(user); }
Example 19
Source File: User2ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatoryException(User2 user){ user2Mapper.insert(user); throw new RuntimeException(); }
Example 20
Source File: User2ServiceImpl.java From transaction-test with MIT License | 4 votes |
@Override @Transactional(propagation = Propagation.MANDATORY) public void addMandatory(User2 user){ user2Mapper.insert(user); }