Announcement Announcement Module
Collapse
No announcement yet.
mode="aspectj". Transaction is not started for method declared in aspects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mode="aspectj". Transaction is not started for method declared in aspects

    Hello,

    I have an application where CRUD service's methods declared in aspects
    Code:
    privileged aspect AddressServiceImpl_Roo_Service {
        
        declare @type: AddressServiceImpl: @Service;
        
        declare @type: AddressServiceImpl: @Transactional;
        
        @Autowired
        AddressRepository AddressServiceImpl.addressRepository;
        
        public void AddressServiceImpl.deleteAddress(Address address) {
            addressRepository.remove(address);
        }
        
        public void AddressServiceImpl.saveAddress(Address address) {
            addressRepository.store(address);
        } 
    ...
    The transaction configuration:
    Code:
        <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>
    aspectj-maven-plugin 1.2 is used for compile time weaving.

    Issue: When service's method is called from none transactional controller or integration test, transaction is not initiated on this method. If method is declared directly in serviceImpl.java, the transaction is started as expected.

    Is there any limitation of aspectj and spring transactions?

    Thank you for help,
    Vladimir
Working...
X