spring-aop

How to automatically set date_created using spring aop

Hello Gurus !!! i've been working on a project in java+maven+spring+hibernate and i wanted to automatically assign the current date to the POJOs before the calling of saveorupdate. i wouldn't mind creating new Date() for all the date_created of all the classes but they are just plenty. I've just discovered that spring aop is good at tho...

Spring AOP and transaction add custom interceptors

My spring definition regarding trasnsaction are defined as following: <bean id="txInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager"/> </bean> <aop:config> <aop:pointcut id="defaultServiceOperation" ex...

Spring - how to gather informations during rollbacks in declarative transaction management

Hi, Could please anybody tell me If it is safe and recommended to catch SQL and other exceptions within @Transactional methods ? When programmatic transaction management is used, I can simply catch the exception and do whatever I want, but I don't know if I don't break the transactional AOP system by catching these exceptions that would...

spring 3.0 aop Pointcut is not well-formed: expecting 'name pattern' error

The following is my pointcut and advise declaration //PointCut on A method which takes two parameters and is in a DAO @Pointcut("execution(backend.repository.QuestionsRepository.AnswerQuestion (..))") public void answerQuestionPointCut() {} @Around( value="web.activity.advisors.UserActivityAdvisor.answerQuestionPointCut()", arg...

Autowiring HibernateInterceptor as Advice

Hi folks, I am trying to use HibernateInterceptor as a Advice and I am trying to autowire it. The code is as follows, @Aspect public class InterceptorAdvice{ private HibernateInterceptor hibernateInterceptor; @Autowired public void setHibernateInterceptor(@Qualifier("hibernateInterceptor") HibernateInterceptor hiber...

Spring aop transaction not committing the transaction

I am using Spring 3.0.3, MyBatis 3.0.2 and mybatis-spring 1.0.0 on Apache Tomcat 6.0.29. I have used declarative transactions of spring for transaction management. The issue is that the transactions are not working for me. The transaction only works once and thereafter nothing. I have tried checking all my configs but no clue. Any poin...

How can I access methods attributes with Spring AOP (AspectJ-style)?

I need to intrecept some methods and their attributes by using annotations as point cuts, but how can I access those method attributes. I have following code that succesfully can run code before method is run, but I just don't know how I can access those attrbiutes. package my.package; import org.aspectj.lang.ProceedingJoinPoint; impor...