All Questions
11 questions
0
votes
1
answer
530
views
JPA lazy insert
There's many posts about lazy fetching in JPAs like e.g. Hibernate. However, I couldn't find one mentioning lazy insert.
Let's say my DAO has a List attribute with public getter and setter. Instead ...
6
votes
2
answers
4k
views
Dynamic Eager & Lazy Loading in Hibernate
I'm new to Hibernate, but have plenty of experience with the Entity Framework in C#. One feature I love is the ability to dynamically decide what to load immediately in a query. For example, consider ...
1
vote
2
answers
2k
views
Eager loading despite Lazy Initialization?
we have an entity that has a lot of ManyToOne, OneToOne, etc relations which themself have again some relations.
For example
@OneToMany(targetEntity = Season.class, cascade = {
CascadeType.ALL
})...
1
vote
1
answer
46
views
ssh4 LazyInitializationException
here is stack:
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:164)
org....
0
votes
1
answer
878
views
session.disconnect() vs Open Session In View(OSIV) which is better?
As per the "Hibernate in action" the best solution of lazy initialization exception is that to use a centralized code from where we can get the session or instead of doing session.close() use session....
15
votes
3
answers
75k
views
Hibernate could not initialize proxy - no Session
My code retrieves all information related to the user:
SessionFactory sessionFactory = HibernateUtilities.configureSessionFactory();
Session session = sessionFactory.openSession();
UserDetails ud = ...
1
vote
2
answers
4k
views
@ManyToMany initiating LazyInitializationException
For the some testing purposes, I'm trying to have JUnit test throwing LazyInitializationException.
My case is that I have 3 entities
@Entity(name = "Role")
public class Role {
@LazyCollection(...
0
votes
1
answer
193
views
Hibernate + OSIV. 2 transactions. Repeatable read
This article states that if we use 2 transactions one for getting first data and afterwords to get the lazy fields, we won't run into any problems since the session is reused and the session itself ...
1
vote
1
answer
331
views
lazy fetching problem
I have a problem with lazy fetching. here's what I have. I have a entity class called channel. and another entity class called show. Each channel has many show's. I've implemented hibernate with lazy ...
0
votes
2
answers
4k
views
Proper use of getHibernateTemplate() in Spring MVC app?
I have a bunch of Hibernate mapped objects in my Spring MVC app. Default seems to be lazy loading for nested objects with relations. I realized this by getting a lot of errors in my JSP when accessing ...
0
votes
1
answer
578
views
Recommendation for using equals in Entities and avoiding LazyInitializationExceptions?
In the beginning there is a problem that wants to be solved. In my case i got an LazyInitializationException while using indexof in a Collection to retrieve an Object for manipulation. Here i start to ...