Top "Lazy-initialization" questions

Lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.

How to solve the LazyInitializationException when using JPA and Hibernate

I am working on a project for a customer who wants to use lazy initialization. They always get "lazy initialization …

java hibernate jpa orm lazy-initialization
How to initialize an array whose size is initially unknown?

Say I have this: int x; int x = (State Determined By Program); const char * pArray[(const int)x]; // ?? How would …

c++ arrays initialization lazy-initialization
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 = null; …

java hibernate persistence lazy-evaluation lazy-initialization
Solve Hibernate Lazy-Init issue with hibernate.enable_lazy_load_no_trans

I have been suffering from infamous hibernate exception org.hibernate.LazyInitializationException: could not initialize proxy - no Session Now the …

java hibernate jpa persistence lazy-initialization
How Hibernate.initialize() works

I know to use lazily load objects/collections outside the session, we do Hibernate.initialize(Object obj) so that object …

java hibernate proxy lazy-initialization
How to implement thread-safe lazy initialization?

What are some recommended approaches to achieving thread-safe lazy initialization? For instance, // Not thread-safe public Foo getInstance(){ if(INSTANCE == null){ …

java thread-safety lazy-initialization
Property initializers run before 'self' is available

Seems like I'm having a problem with something that shouldn't be the case... But I would like to ask for …

swift class properties init lazy-initialization
Singleton lazy vs eager instantiation

If a singleton is implemented as follows, class Singleton { private static Singleton instance = new Singleton(); public static Singleton getInstance() { return …

java singleton lazy-initialization
Could not initialize proxy - No Session again

I get these error log when viewing a page ERROR [TP-Processor11] (LazyInitializationException.java:42) - could not initialize proxy - no …

hibernate lazy-initialization
Lazy field initialization with lambdas

I would like to implement lazy field initialization (or deferred initialization) without an if statement and taking advantage of lambdas. …

lambda java-8 lazy-initialization