Hi Shreyansh , Thanks for these notes they are a great help to get through your videos fast and revise/recollect them. Just one request , could you complete the PDF upload for SPRING BOOT , the current drive has PDF files upto the 15 th video only
1) Can a single entitymanager cache multiple entities if it has to work on multiple entities in a single http request ? 2) What if some other request happened, and entity manager 2 updated the same entity that entity manager 1 is updated and put it in cache ? Then, the next operations on the smae entity will return the cache data of entity manager 1 right, which means stale data ?
1. Yes multiple entities are cached per entity manager. 2. The use case which you have mentioned, in such scenario, Entity manager 1, might read stale data, if EntityManager2 updates the same entity. As they both are operating in isolation and Entity Manager1 is not aware of changes done by entityManager2. Some of the solutions for these are : - Optimistic locking - Avoid Long lived Entity Managers - Or Explicitly Refresh the EntityManager like EntityManager.refrest(entity), it will sync the data with the db
Hi Shrayansh, you have put great content so far and it’s very helpful. Could you tell me by when will the springboot playlist gets completed..So that it helps us in interviews
If we try to call the jpa layer from the async flow (branching out from the main request flow) how entity manager creation will be handled in that new async thread?
this is my understanding: If you call a JPA repository or use EntityManager within an async task, Spring will Create a new EntityManager for that thread (if the method is transactional or a new transaction is required). If there is no transaction, EntityManager call will fail unless explicitly configured with a Propagation.REQUIRES_NEW. we can test this understanding once.
The EntityManager is not dependent on @Transactional for its existence or basic operations (like reading or managing entities within the persistence context during a request). However, @Transactional is required to define transactional boundaries for writing to the database, ensuring consistency and atomicity. In short, the EntityManager is tied to the request lifecycle, while @Transactional governs the transaction lifecycle. They are complementary but not dependent on each other for basic persistence operations.
Hi bro, I have a confusion , when you are saying each http request 1 entityManager will be created so it means every http request when we hit or it means every http request which have different url create entityManager . Or same http requests create entityManager every time . And if each http request create new entityManager then what is the meaning of caching .
each HTTP request, default we create one entity manager. Whats the use: lets say in 1 Call, you are fetching one entity multiple times, then only 1 time DB hit will happen.
In a Spring JPA application, a new EntityManager is created for each HTTP request. Even if the same endpoint is hit multiple times, each request gets its own EntityManager.
Use is it is given out of the box by Hibernate. We are not configuring any Cache as such. Without Hibernate L1 Cache there would be too much DB hits. Since Hibernate gives the L1 Cache feature out of the box the number of database hits are reduced.
voice changed? its might be new youtube feature, pls check video setting "select original". i think youtube have launched new audio feature, in which in multiple language we can watch the video.
Thanks Shreyansh one more time for making amazing video
Please add videos on Spring Security, and Spring Reactive Programming using WebFlux and WebClient
Why your part 2 paid?...here many people have no finance to pay your subscription
U study from here then will get good package, will u give some part of ur package to him ??
No, right?
That's why
@@hiteshpant9868 Did you understand the context?
Net recharge krne ke liye paise h toh yeh b kr skte h bro
To mat dekh na bhai tera theka le rakha h kya kisi ne
@@harshitrastogi866 tujse bola kya chup le varna gali khayega
Hi Shreyansh , Thanks for these notes they are a great help to get through your videos fast and revise/recollect them.
Just one request , could you complete the PDF upload for SPRING BOOT , the current drive has PDF files upto the 15 th video only
Another informative vid. Thanks
Hi , when we expect the microservices ,spring security ? could you tell the tentative ending date of this series as you have planned ?
1) Can a single entitymanager cache multiple entities if it has to work on multiple entities in a single http request ?
2) What if some other request happened, and entity manager 2 updated the same entity that entity manager 1 is updated and put it in cache ? Then, the next operations on the smae entity will return the cache data of entity manager 1 right, which means stale data ?
1. Yes multiple entities are cached per entity manager.
2. The use case which you have mentioned, in such scenario, Entity manager 1, might read stale data, if EntityManager2 updates the same entity. As they both are operating in isolation and Entity Manager1 is not aware of changes done by entityManager2.
Some of the solutions for these are :
- Optimistic locking
- Avoid Long lived Entity Managers
- Or Explicitly Refresh the EntityManager like EntityManager.refrest(entity), it will sync the data with the db
Hi Shrayansh, you have put great content so far and it’s very helpful. Could you tell me by when will the springboot playlist gets completed..So that it helps us in interviews
Hi Shrayansh.. Apprecieate the work you are doing but there are missing notes in pdf drive after the async . Please update the notes ASAP.
Hi bro. When can we expect the next video?
Why jpa part 2 video is not there, is it removed?
nope ita there
I m not able to see it .... Though I have watched it but not visible now.
@@talhakhan4329 JPA part 2 is for Members only
If we try to call the jpa layer from the async flow (branching out from the main request flow) how entity manager creation will be handled in that new async thread?
this is my understanding:
If you call a JPA repository or use EntityManager within an async task, Spring will
Create a new EntityManager for that thread (if the method is transactional or a new transaction is required).
If there is no transaction, EntityManager call will fail unless explicitly configured with a Propagation.REQUIRES_NEW.
we can test this understanding once.
@ConceptandCoding thanks for the reply. I will try that out. :)
Hey Shrayansh ,
How the EntityManager and @Transactional are related to each other ?
The EntityManager is not dependent on @Transactional for its existence or basic operations (like reading or managing entities within the persistence context during a request).
However, @Transactional is required to define transactional boundaries for writing to the database, ensuring consistency and atomicity.
In short, the EntityManager is tied to the request lifecycle, while @Transactional governs the transaction lifecycle. They are complementary but not dependent on each other for basic persistence operations.
Sir i have joined the channel but still not able JPA part 2 video #23 video can u please check on this
kindly check the membership level if "Unlock Java, springboot" one is selected
Commenting here to come back
When the part of second level of cache?
This pkaylist it will covers lazy ,eager ,optimization?
Thank u for content
Shrayansh bhaiya, Part 2 of JPA is members only. Can you fix this please?
By when will the spring boot series be completed?
Most probably 1 year
Hi Shrayansh, Could you explain persistence context wrt native queries
Waiting for this JPA part 3
uploaded
Whole jpa part 1and 3 also locked for members 🎉❤
Nice video, can you make a video on novartis, it is organizing a challenge called NEST & hiring students through it
noted
Bhai agla video kb tak aayega jpa ka?
hello Shrayansh bhai pls tell us when this will be completed coz I hv interview pls reply bro thanks for the wonderful content
waiting for part 3
uploaded
Hi bro,
I have a confusion , when you are saying each http request 1 entityManager will be created so it means every http request when we hit or it means every http request which have different url create entityManager . Or same http requests create entityManager every time . And if each http request create new entityManager then what is the meaning of caching .
each HTTP request, default we create one entity manager.
Whats the use:
lets say in 1 Call, you are fetching one entity multiple times, then only 1 time DB hit will happen.
In a Spring JPA application, a new EntityManager is created for each HTTP request. Even if the same endpoint is hit multiple times, each request gets its own EntityManager.
Same doubt I have!!!
Use is it is given out of the box by Hibernate. We are not configuring any Cache as such.
Without Hibernate L1 Cache there would be too much DB hits.
Since Hibernate gives the L1 Cache feature out of the box the number of database hits are reduced.
please add this in udemy
Please upload new videos..
Part 2 removed?
nope
Plz provide project bcz i need to add in resume
Audio in japanese 😂😅
Edit: you can change it in settings ->audio track
:) yes its a new feature. Select original voice
if you change the audio track of this video to hindi,, oh my god AI is speaking ..and what a tough hindi.... try once people
Why this video is not in your voice, some ai
i change the audio to original in video settings, i think new youtube feature is added
@@ConceptandCoding now, how should i remove it
Funny Hindi audio track! For a few seconds, I was wondering if I was on the right channel.
yes its a youtube feature, in video setting, choose audio track and change it to original :)
Why voice is changed sir😢
voice changed? its might be new youtube feature, pls check video setting "select original".
i think youtube have launched new audio feature, in which in multiple language we can watch the video.
@@ConceptandCoding
Only in this video robotic voice is coming rest videos are ok
yes, from video setting, in audio track, select Original.
This is new TH-cam feature added. in 10 different language you can watch now
Ok got it 🥲
great Stuff
👍👍