Issue 1:
Reto Urfer opened SPR-9020 and commented

The Hibernate4 support of Spring 3.1 does not open and register a session in case of the method called is annotated with @Transactional(propagation = Propagation.SUPPORTS).

In this case HibernateTransactionManager.doBegin() is never called which is the only place where hibernate session is opened. The result is, that all read operations which do not require a transaction will fail because the call to SessionFactory.currentSession() will result in an exception.

The Hibernate3 implementation contains a fallback for this case in SessionFactoryUtils.doGetSession(...) which is missing in the corresponding Hibernate4 implementation of SpringSessionContext.currentSession().

If the transaction propagation is changed to REQUIRES_NEW everything is working fine.

Affects: 3.1 GA

Issue Links:

#16421 Hibernate4 version of SpringSessionContext.currentSession() does not create a session if TransactionSynchronizationManager does not contain one ("is duplicated by")

#13548 org.springframework.orm.hibernate4.HibernateTransactionManager fails with NoSuchMethodError against SessionFactory.getCurrentSession()

#17680 H4 SpringSessionSynchronization#beforeCompletion leaves irreparably broken state if exception thrown in session.disconnect()

#16954 HibernateTransactionManager should allow holdability of ResultSet into the View layer

19 votes, 28 watchers

Issue 2:
Jan Dudek opened SPR-9030 and commented

Let's have this following class:

@Component
public class TestClass {
private List<RelatedClass2> propertyRelatedClasses;

public List<RelatedClass2> getPropertyRelatedClasses() {
return propertyRelatedClasses;
}

@Inject
public void setPropertyRelatedClasses(Provider<List<RelatedClass2>> propertyRelatedClassesProvider) {
this.propertyRelatedClasses = propertyRelatedClassesProvider.get();
}
}

I want to inject a `List` of all existing instances of type `RelatedClass2` using a Provider. What I get is:

...

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [java.lang.Object] is defined: expected single matching bean but found 15: [relatedClass1, 2b, 2a, org.springframework.context.annotation.internalConfigurationAnnotationProcessor, org.springframework.context.annotation.internalAutowiredAnnotationProcessor, org.springframework.context.annotation.internalRequiredAnnotationProcessor, org.springframework.context.annotation.internalCommonAnnotationProcessor, org.springframework.context.annotation.internalPersistenceAnnotationProcessor, org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0, environment, systemProperties, systemEnvironment, importRegistry, messageSource, applicationEventMulticaster]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:800)

at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectFactory.getObject(DefaultListableBeanFactory.java:1023)

at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyProvider.get(DefaultListableBeanFactory.java:1038)

at com.gooddata.connectors.restapi.controller.springtest.TestClass.setPropertyRelatedClasses(TestClass.java:25)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

The ```
2a
``` and
```2b
``` beans are of type `RelatedClass2`.

Affects: 3.1 GA

Issue Links:

#13730 Injecting / autowiring collection provider doen't work ("is duplicated by")

Referenced from: commits c55362c