Hi Guys,
I have run into some wierd problem around txAdvice where I have got stuck.
Basically from my code ,I am callingMy TxAdvice and point cut are as belowCode:iCreateConService.createCon(createConDTO)
.Code:<tx:advice id="txAdvice"> <!-- the transactional semantics... --> <tx:attributes> <!-- all methods starting with 'get' are read-only --> <tx:method name="get*" read-only="true" /> <!-- other methods use the default transaction settings (see below) --> <tx:method name="*" /> </tx:attributes> </tx:advice> <aop:advisor advice-ref="txAdvice" pointcut-ref="createCon"/> <aop:pointcut id="createCon" expression="execution(* al.am.business.createcon.ICreateConService.*(..))"/>
Now Whenever I am calling iCreateConService.createCon(createConDTO),I am running into some transaction blues.
On further debugging I found that advice is not applied across iCreateConService always.
But sometimes advice does get applied and transaction is created like below
Code:2012-03-27 23:35:00,140 INFO [STDOUT] Rip is executing 2012-03-27 23:15:00,278 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Using transaction object [org.springframework.orm.jpa.JpaTransactionManager$JpaTransactionObject@2fc718bd] 2012-03-27 23:15:00,278 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Creating new transaction with name [al.am.business.createcon. ICreateConService.createCon]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 2012-03-27 23:15:00,278 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Opened new EntityManager [org.eclipse.persistence.internal.jpa.EntityManagerImpl@382938cc] for JPA transaction 2012-03-27 23:15:00,279 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] Bound value [org.springframework.orm.jpa.EntityManagerHolder@1a4ff5e2] for key [org.springframework.orm.jpa.LocalEntityManagerFactoryBean@2efe6454] to thread [EftScheduler_Worker-1] 2012-03-27 23:15:00,279 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] Initializing transaction synchronization 2012-03-27 23:15:00,279 DEBUG [org.springframework.transaction.interceptor.TransactionInterceptor] Getting transaction for [al.am.business.createcon. ICreateConService.createCon] 2012-03-27 23:15:00,279 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] Retrieved value [org.springframework.orm.jpa.EntityManagerHolder@1a4ff5e2] for key [org.springframework.orm.jpa.LocalEntityManagerFactoryBean@2efe6454] bound to thread [EftScheduler_Worker-1] 2012-03-27 23:15:00,279 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Found thread-bound EntityManager [org.eclipse.persistence.internal.jpa.EntityManagerImpl@382938cc] for JPA transaction 2012-03-27 23:15:00,279 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Using transaction object [org.springframework.orm.jpa.JpaTransactionManager$JpaTransactionObject@7797d5ec] 2012-03-27 23:15:00,279 DEBUG [org.springframework.orm.jpa.JpaTransactionManager] Participating in existing transaction 2012-03-27 23:15:00,279 DEBUG [org.springframework.transaction.interceptor.TransactionInterceptor] Getting transaction for [al.am.business.createcon. ICreateConService.createCon
But sometimes when advice is not applied.You can see the below logs doesnt show anything.
Can someone please let me know where I am going wrong or point me in the correct directionCode:2012-03-27 23:35:00,140 INFO [STDOUT] Rip is executing 2012-03-27 23:35:00,141 DEBUG [org.springframework.orm.jpa.JpaTemplate] Creating new EntityManager for JpaTemplate execution 2012-03-27 23:35:00,141 DEBUG [gl.am.framework.dao.QueryBuilder] Query = select model from EventRuleFlowMap model WHERE model.processTemplateCode = :processTemplateCode AND model.processTemplateTypeCode = :processTemplateTypeCode 2012-03-27 23:35:00,142 DEBUG [org.springframework.orm.jpa.JpaTemplate] Closing new EntityManager after JPA template execution 2012-03-27 23:35:00,142 DEBUG [org.springframework.orm.jpa.EntityManagerFactoryUtils] Closing JPA EntityManager 2012-03-27 23:35:00,142 INFO [al.am.integration.dao.jpa.businessruleflow.BusinessRuleFlowDAO] finding BusinessRuleFlow instance with id: rf1_cc 2012-03-27 23:35:00,144 DEBUG [org.springframework.orm.jpa.JpaTemplate] Creating new EntityManager for JpaTemplate execution 2012-03-27 23:35:00,145 DEBUG [org.springframework.orm.jpa.JpaTemplate] Closing new EntityManager after JPA template execution 2012-03-27 23:35:00,145 DEBUG [org.springframework.orm.jpa.EntityManagerFactoryUtils] Closing JPA EntityManager 2012-03-27 23:35:00,146 INFO [al.am.integration.dao.jpa.businessruleser


Reply With Quote