Browse files

UP-3536 Fix transaction application

  • Loading branch information...
1 parent 4dcbce0 commit 0a83b52f118e751019ec2ece10ab54c9373e1fc2 @edalquist committed Aug 7, 2012
View
12 uportal-war/src/main/java/org/jasig/portal/portlet/dao/jpa/JpaPortletDefinitionDao.java
@@ -144,7 +144,7 @@ protected void addFetches(final Root<PortletDefinitionImpl> definitionRoot) {
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefinitionId) {
Validate.notNull(portletDefinitionId, "portletDefinitionId can not be null");
@@ -156,7 +156,7 @@ public IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefin
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletDefinition getPortletDefinition(String portletDefinitionIdString) {
Validate.notNull(portletDefinitionIdString, "portletDefinitionIdString can not be null");
@@ -168,7 +168,7 @@ public IPortletDefinition getPortletDefinition(String portletDefinitionIdString)
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletDefinition getPortletDefinitionByFname(String fname) {
final NaturalIdQuery<PortletDefinitionImpl> query = this.createNaturalIdQuery(PortletDefinitionImpl.class);
@@ -177,7 +177,7 @@ public IPortletDefinition getPortletDefinitionByFname(String fname) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletDefinition getPortletDefinitionByName(String name) {
final TypedQuery<PortletDefinitionImpl> query = this.createCachedQuery(this.findDefinitionByNameQuery);
@@ -188,7 +188,7 @@ public IPortletDefinition getPortletDefinitionByName(String name) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public List<IPortletDefinition> searchForPortlets(String term, boolean allowPartial) {
final CriteriaQuery<PortletDefinitionImpl> criteriaQuery;
@@ -226,7 +226,7 @@ public void deletePortletDefinition(IPortletDefinition definition) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public List<IPortletDefinition> getPortletDefinitions() {
final TypedQuery<PortletDefinitionImpl> query = this.createCachedQuery(this.findAllPortletDefinitions);
View
8 uportal-war/src/main/java/org/jasig/portal/portlet/dao/jpa/JpaPortletEntityDao.java
@@ -152,7 +152,7 @@ public void deletePortletEntity(IPortletEntity portletEntity) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletEntity getPortletEntity(IPortletEntityId portletEntityId) {
Validate.notNull(portletEntityId, "portletEntityId can not be null");
@@ -176,7 +176,7 @@ public boolean portletEntityExists(IPortletEntityId portletEntityId) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public IPortletEntity getPortletEntity(String layoutNodeId, int userId) {
Validate.notNull(layoutNodeId, "portletEntity can not be null");
@@ -196,7 +196,7 @@ public IPortletEntity getPortletEntity(String layoutNodeId, int userId) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public Set<IPortletEntity> getPortletEntities(IPortletDefinitionId portletDefinitionId) {
Validate.notNull(portletDefinitionId, "portletEntity can not be null");
@@ -211,7 +211,7 @@ public IPortletEntity getPortletEntity(String layoutNodeId, int userId) {
}
@Override
- @DialectAwareTransactional(PostgreSQL81Dialect.class)
+ @DialectAwareTransactional(value = PostgreSQL81Dialect.class, exclude = false)
@PortalTransactionalReadOnly
public Set<IPortletEntity> getPortletEntitiesForUser(int userId) {
final TypedQuery<PortletEntityImpl> query = this.createCachedQuery(this.findEntitiesForUserIdQuery);
View
2 uportal-war/src/main/java/org/jasig/portal/spring/tx/DialectAwareTransactionInterceptor.java
@@ -165,7 +165,7 @@ public TransactionAttribute getTransactionAttribute(Method method, Class<?> targ
//Proxy the existing transactionAttribute to mix in our SkipTransactionAttribute interface
return (TransactionAttribute)Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
+ DialectAwareTransactionInterceptor.class.getClassLoader(),
interfaces.toArray(new Class<?>[interfaces.size()]),
new InvocationHandler() {
@Override
View
23 uportal-war/src/main/java/org/jasig/portal/spring/tx/DialectAwareTransactionalAspect.java
@@ -1,23 +0,0 @@
-package org.jasig.portal.spring.tx;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.jasig.portal.concurrency.caching.RequestCache;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class DialectAwareTransactionalAspect {
-
-
-
- @Pointcut(value="execution(public * *(..))")
- public void anyPublicMethod() { }
-
- @Around("anyPublicMethod() && @annotation(requestCache)")
- public Object dialectAwareTransactional(ProceedingJoinPoint pjp, RequestCache requestCache) throws Throwable {
-
- }
-}

0 comments on commit 0a83b52

Please sign in to comment.