Thanks for your real-time examples, all your videos are very much useful for real time implementation of different micro service concept. Keep uploading such kind of informative videos
@@JavaTechSolutions one more doubt is @version annotation and version field needed if we are using Pessimistic locking? Can we remove that field and annotation in entity?
Hello sir, I didn't understand one thing : How ticket was saved in db with "BusId" ? Because In the code busDetails was not saved in ticket object.. Yes.. ticket was added in Bus entity , but still this Bus entity was not saved.. Pls suggest
Its depends. Looking mechanism should be used if you want to maintain the data consistency then locking should be used. Even if same data used by multiple thread then locking can be used. Regarding saga design pattern is used based on scenario. It will be used if we want to maintained transaction in multiple microservices.
Thanks for your real-time examples, all your videos are very much useful for real time implementation of different micro service concept. Keep uploading such kind of informative videos
Thanks
Thank you, you have explained very well optimistic n pessimistic locking using real time example .
@@ramanandkumar7780 thank you
Thank you for your videos with real time projects. Please make more videos on Spring boot and spring cloud technologies.
Thanks
Great Explanation. Thank you so much.
You are welcome!
you picked a good example to explain the locking mechanism
Thank you
Excellent explanation keep videos on spring boot coming 🙌🏻
Sure.. Thanks
In the case of rollback scenario which lock type is suitable
Both approach are fine... Depends on your needs
good explanation !!!
Thanks
How can we have the lock if we are using custom queries using Criteria API
Lock can happen on the table level
Hello great vedio is it same process for old springboot versions also?
It should work. Only little bit modification is required as in Java 17 and spring boot 3 modified lots of thing
@@JavaTechSolutions thank you
@@JavaTechSolutions one more doubt is @version annotation and version field needed if we are using Pessimistic locking?
Can we remove that field and annotation in entity?
@Version is needed for pessimistic lock also?
For applying optimistic lock version annotation is required. But for pessimistic locking version annotation not needed
Can this be useful when we have the same application deployed on multiple instances?
I believe so
If possible can we give priority for transaction for eg bookTicket1 have high priority
We can set the priority for the transaction
As i understand This lock mechanism only work for one instance ?
İf we have 2 instance we should use saga ?
If any transaction started in any instance then it will complete for that instance only
you are always fetching 1L
record only with the method findwithLocationById(2) can we use like this ? I mean can we pass 3L
You can pass the I'd in dynamic nature
Hello sir,
I didn't understand one thing :
How ticket was saved in db with "BusId" ? Because In the code busDetails was not saved in ticket object..
Yes.. ticket was added in Bus entity , but still this Bus entity was not saved..
Pls suggest
It's a cascading save
Hi. When should we use saga design pattern or when should we use locking mechanisn ?
Its depends. Looking mechanism should be used if you want to maintain the data consistency then locking should be used. Even if same data used by multiple thread then locking can be used. Regarding saga design pattern is used based on scenario. It will be used if we want to maintained transaction in multiple microservices.
@@JavaTechSolutions we cant use locking mechanism when there is 3rd party post api. As we dont have source code in that case. Is that make sense ?
@@puneetsaneja3007 yes... True...
Creating entity is not a part of lesson. Pls do it before video. Not in the video
Waste time , first 40 mins was for project creation , eventually just add 1 annotation and dont explain what it does
Thank you for your concern... But it's in from beginning
you should switch off your clicks buddy
@@mercelessmonk957 Already taken care.. Thank you