LazyInitializationException: What it is and the best way to fix it

  Рет қаралды 14,630

Thorben Janssen

Thorben Janssen

Күн бұрын

Пікірлер: 14
@valkon_
@valkon_ 2 жыл бұрын
8k views only. This video contains at least two interview questions. Thank you for everything Thorben.
@Beatsmusic777
@Beatsmusic777 4 жыл бұрын
Thanks! Need deep explanation JPA Graph Entity with example!
@Gohel95
@Gohel95 4 жыл бұрын
thanks for helping me because I face LazyInitializationException many times but didn't able to understand which solution is a batter choice.
@ThoughtsOnJava
@ThoughtsOnJava 4 жыл бұрын
I am glad this helped.
@Gohel95
@Gohel95 4 жыл бұрын
while fetching data from the database sometimes we get recursive data with a stack overflow error, so which is the best way to solve it @jsonIgnore or @jsonBackReferecnce? everyone encounters this once while working with hibernate so what's your answer for this sir?
@varun104
@varun104 3 жыл бұрын
So when you say use Graph or join fetch clause you mean not using the regular find methods of the entity manager and executing the query within the same session ?? Also, One day I fixed the exception using the @Transactional annotation. Does that mean, I opened the session again to load the lazy field ? Please let me know what your thoughts are. thanks
@Joseph-oz7tx
@Joseph-oz7tx 5 ай бұрын
like always very nice video.
@TheMartin68261
@TheMartin68261 Жыл бұрын
Is JPA 2.1 Supports JRE 7
@Gohel95
@Gohel95 4 жыл бұрын
while fetching data from the database sometimes we get recursive data with a stack overflow error, so which is the best way to solve it @jsonIgnore or @jsonBackReferecnce? everyone encounters this once while working with hibernate so what's your answer for this sir?
@varun104
@varun104 3 жыл бұрын
Never got
@krishnapanigrahi6926
@krishnapanigrahi6926 3 жыл бұрын
If we declare entire method with @Trasactional then will not get this exception. This way is correct or not?
@varun104
@varun104 3 жыл бұрын
You asked what I was thinking man. The other day even I fixed the issue by marking the method as @Transactional of spring framework. I think that opened the session again for the code we wrote in the method. But my technical manager accepted the solution. I hope he replies to this.
@RedJackWZ
@RedJackWZ 3 жыл бұрын
I don't use @Transactional, I think you should use FTP instead
@meetmandhane
@meetmandhane Жыл бұрын
Should we use @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) on the class causing this error? This seems to fix the issue.
Spring & Spring Data JPA: Managing Transactions
10:34
Thorben Janssen
Рет қаралды 64 М.
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 16 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 111 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,4 МЛН
Выпуск 139. Возвращаемся к LazyInitializationException.
20:50
How to call native SQL queries with JPA and Hibernate
13:46
Thorben Janssen
Рет қаралды 4,4 М.
The Best Mapping for Shared Technical Attributes With Hibernate
9:07
Thorben Janssen
Рет қаралды 1,6 М.
Hibernate Proxies - Why they’re used and How to Unproxy them
8:47
Thorben Janssen
Рет қаралды 4,1 М.
What is Span in C# and why you should be using it
15:15
Nick Chapsas
Рет қаралды 256 М.
JPA & Hibernate - Why, When & How to use DTO Projections
10:38
Thorben Janssen
Рет қаралды 16 М.
FlushMode in JPA and Hibernate - What it is and how to change it
10:41
Thorben Janssen
Рет қаралды 4,2 М.
The Problem With Microservices
17:47
Continuous Delivery
Рет қаралды 435 М.
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 16 МЛН