No transaction with AOP using spring-flex

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

No transaction with AOP using spring-flex

Jaabax
hi

does anyone know how spring-flex obtain my service beans during a request? does it gets from the context? I have no transaction opened when I call a service like:

@Service
@RemotingDestination
public class GenericServiceImpl extends CrudService implements GenericService {

        @Autowired
        private GenericRepository genericRepository;

        @Override
        protected GenericRepository getRepository() {
                return genericRepository;
        }

}

I get a "No transactional EntityManager available"...

btw I am using XML declarative transactions with AOP.. dont want to annotate all classes with @transactional

when I inject this service in my tests all works well
I created a spring mvc project to inject the service on the controller and all worked well too

I believe its the way that spring-flex retrieve my service bean from the contex

any help?

thank you very much!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No transaction with AOP using spring-flex

Jaabax
This post was updated on .
The problem was in the point-cut defined in the Spring context.
I changed from:

<aop:pointcut id="services-pointcut" expression="execution(* my.services.pkg.*.*(..))" />

To:

<aop:pointcut id="services-pointcut" expression="bean(*ServiceImpl)" />

Anyone got it working using "execution" instead of "bean"?

Thank you.
Loading...