could not initialize proxy - no Session
As i m trying to using the load method and trying to access the session object outside the transactional context. But its working fine for me , no exception at all and i m succesfully able to return the results. Anyone can throw some light on it , why is it behaving like this.
Quote from Java Persistence with Hibernate:
"More important, the load() method may return a proxy, a placeholder, without hitting the database. ... The load() method always tries to return a proxy, and only returns an initialized object instance if it's already managed by the currrent persistence context."
Do you see a select-statement when you call the get-method?
yes , i do see the select statement when getter gets called...Important point over here is session is under no transactional context, how can it result in firing the query after commiting the transaction
Hibernate: select user0_.id as id1_0_, user0_.password as password1_0_ from User user0_ where user0_.id=?
transaction after commitingabc123