Hello ranchers,
I have a small problem in my application. It is developed to work on mobile interfaces, so I need it as lightweight as possible. I'm refactoring my code to reach that, but I came across a problem with the session. My entities were with FetchType.EAGER, so I changed it to lazy. Here is the exception:
I read that it occurs because Hibernate tries to access the property in lazy time with a proxy, but it fails because there is no session. I am using declarative transaction with Spring, so it manages the sessions to me.
Is there any way to make Hibernate (or Spring) create that session automatically? A bean or something? Here is my applicationContext.xml:
Any help would be appreciated.
I have a small problem in my application. It is developed to work on mobile interfaces, so I need it as lightweight as possible. I'm refactoring my code to reach that, but I came across a problem with the session. My entities were with FetchType.EAGER, so I changed it to lazy. Here is the exception:
I read that it occurs because Hibernate tries to access the property in lazy time with a proxy, but it fails because there is no session. I am using declarative transaction with Spring, so it manages the sessions to me.
Is there any way to make Hibernate (or Spring) create that session automatically? A bean or something? Here is my applicationContext.xml:
Any help would be appreciated.