title: LazyInitializationException trying to get lazy initialized instance
body: <p>I see the following exception message in my IDE when I try to get lazy initialized entity (I can't find where it is stored in the proxy entity so I can't provide the whole stack trace for this exception):</p>
  
  <pre><code>Method threw 'org.hibernate.LazyInitializationException' exception. Cannot evaluate com.epam.spring.core.domain.UserAccount_$$_jvste6b_4.toString()
  </code></pre>
  
  <p>Here is a stack trace I get right after I try to access a field of the lazy initialized entity I want to use:</p>
  
  <pre><code>org.hibernate.LazyInitializationException: could not initialize proxy - no Session
  
      at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:165)
  
      at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:286)
  
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)
  
      at com.epam.spring.core.domain.UserAccount_$$_jvstfc9_4.getMoney(UserAccount_$$_jvstfc9_4.java)
  
      at com.epam.spring.core.web.rest.controller.BookingController.refill(BookingController.java:128) 
  </code></pre>
  
  <p>I'm using Spring Data, configured JpaTransactionManager, database is MySql, ORM provider is Hibernate 4. Annotation @EnableTransactionManagement is on, @Transactional was put everywhere I could imagine but nothing works.</p>
  
  <p>Here is a relation:</p>
  
  <pre><code>@Entity
  public class User extends DomainObject implements Serializable {
  
      ..
  
      @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
      @JoinColumn(name = "user_fk")
      private UserAccount userAccount;
  
      ..
  
  @Entity
  public class UserAccount extends DomainObject {
  
      ..
  
      @OneToOne(mappedBy = "userAccount")
      private User user;
  
      ..
  </code></pre>
  
  <p>.. a piece of configuration:</p>
  
  <pre><code>    @Bean
      public DataSource dataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName(env.getRequiredProperty(PROP_NAME_DATABASE_DRIVER));
          dataSource.setUrl(env.getRequiredProperty(PROP_NAME_DATABASE_URL));
          dataSource.setUsername(env.getRequiredProperty(PROP_NAME_DATABASE_USERNAME));
          dataSource.setPassword(env.getRequiredProperty(PROP_NAME_DATABASE_PASSWORD));
          return dataSource;
      }
  
      @Bean
      public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
          LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactoryBean.setDataSource(dataSource());
          entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
          entityManagerFactoryBean.setPackagesToScan(env.getRequiredProperty(PROP_ENTITYMANAGER_PACKAGES_TO_SCAN));
          entityManagerFactoryBean.setJpaProperties(getHibernateProperties());            
          return entityManagerFactoryBean;
       }
  
      @Bean
      public JpaTransactionManager transactionManager(@Autowired DataSource dataSource,
                                                      @Autowired EntityManagerFactory entityManagerFactory) {
          JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
          jpaTransactionManager.setEntityManagerFactory(entityManagerFactory);
          jpaTransactionManager.setDataSource(dataSource);
  
          return jpaTransactionManager;
      }
  </code></pre>
  
  <p>.. and this is how I want to retrieve UserAccount:</p>
  
  <pre><code>    @RequestMapping(...)
      @Transactional()
      public void refill(@RequestParam Long userId, @RequestParam Long amount) {
          User user = userService.getById(userId);
          UserAccount userAccount = user.getUserAccount();
          userAccount.setMoney(userAccount.getMoney() + amount);
      }
  </code></pre>
  
  <p>Hibernate version is 4.3.8.Final, Spring Data 1.3.4.RELEASE and MySql connector 5.1.29.</p>
  
  <p>Please, ask me if something else is needed. Thank you in advance!</p>