Spring Wrap Transactional Authentication Security Provider

In my custom authentication provider, I was able to get the domain object through my Service API, but when I scanned from one domain object to another to get a specific value to perform additional checks, Spring complains that the Hibernate session is not working, t exists: -

domain.getAnotherDomain().getProperty(); // epic FAIL

I have the following AOP transaction for transferring all my project APIs with a transaction, and I am sure that my custom authentication provider will fall into the following pattern: -

<tx:advice id="txAdvice">
    <tx:attributes>
        <tx:method name="*" propagation="REQUIRED" />
    </tx:attributes>
</tx:advice>

<aop:config>
    <aop:advisor pointcut="execution(* my.project..*.*(..))" advice-ref="txAdvice" />
</aop:config>

I also have the OpenSessionInView filter installed, but I don't think this applies to Spring Security anyway.

, API- , , .

? .

+5
4

- API- , .

+2

Spring , Hibernate

, , , , ? - , , " ", :

.

domain.getAnotherDomain() GetProperty();//epic FAIL

, - , , : fetch=FetchType.EAGER, , .

+1

, , Spring Security, OpenSessionInView web.xml. , .

, Spring Security , Hibernate OpenSessionInView, .

0

, - .

, , , @Transactional , .

retreiveUser AbstractUserDetailsAuthenticationProvider. (. authenticate) - AOP. @Transactional , @Transactional anotation?

Spring AOP. - AOP . - AOP , .

0

All Articles