To give you more details:
The exception occurs when a getter is invoked when
a session is already closed. I don't know Hibernate well and don't know if it is correct, but a user object returned is of proxy type. Afterwards when a getter is invoked a CGLIBLazyInitializer.intercept and AbstractLazyInitializer is invoked which throws the exception.
When I added @Proxy(lazy=false) in both a User and a Place class the eager loading works.
Code:
@Entity()
@Table(name = "user")
@Proxy(lazy = false)
public class User {..}
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "placetype", discriminatorType = DiscriminatorType.STRING)
@Table(name = "place")
@Proxy(lazy = false)
public abstract class Place {}
Where do you suggest to take a look at in the debuggger to find what;s wrong?
Thanks,
Maciek