Vaibhav Gargs

Ranch Hand
+ Follow
since Sep 08, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Vaibhav Gargs

Thank you Tim. Can you please help me understand how propagation occurs at DB level. We run the SQL queries separately, so, how they can overlap each others' calls?
23 hours ago
Just thought of discussing the most critical hard to debug issues which you guys have experienced in PRODUCTION. It will give us some learning for future projects.
23 hours ago
Thanks Tim.

I am going through the spring transactions and there is so much emphasis on these concepts there. I am just thinking if it can be handled at DB side then why there is a provision of these on java APIs.

And I can understand that isolation can be handled at DB side but just unable to grasp that propagation can be handled at DB side since it is a related to one method rivalling another method and transaction boundaries withinmethods I may be wrong because I am not an expert.
1 day ago
I am thinking of preparing for Architect Certification. Please guide me for the websites, books, etc. that can be utilized for preparation.
I have some doubts regarding the Transactions Propagation & Isolation levels. Consider the code snippet below:

I have below doubts:

1. Where we need to put the Propagation levels: On method m1 or m2? I hope it needs to be on m2?
2. Can we place propagation level on both the methods as well? I hope it can't be on m1?
3. Where we can put the isolation levels? I think it needs to be placed on just one method and it will be applicable to that method only, please correct me if I am wrong.
1 day ago
Suppose I have following piece of code:

We are calling METHOD1() from synchornized block. In synchronized block, we have a lock on an object, so, when the control goes to METHOD1(), then, does the thread holds that lock or releases it? And, since METHOD1 is not synchronized, so, other threads can access this method simultaneously, correct?
Thank you Paul & Stephan for your valuable inputs.

Suppose, I have below methods:

There are 2 threads: t1 & t2. t1 is executing method1 & t2 is executing method2 - both of which are not synchronized but i is volatile. I understand that these operations are not atomic.

Just wanted to check what are the possible outcomes of value of i? It can be 3 or 6? When the addition operation is performed by one thread say t1, won't it reflect the same value in main memory and forces t2 to read again before performin i+5?
Congratulations on your achievement!
I just observed that we don't have few Atomic classes such as:


Just wondering why these classes were not required?
5 days ago
I am going through multiple posts about Metaspace:

... etc...

In these, they have mentioned about native memory.
If we declare a variable as volatile and the same is being used in synchroinzed block. Then, other threads will be able to access this variable or not? Because as per volatile context, the updated value will be visible to other threads but as per synchronized context, other threads won't be able to access.

Don't know but I am finding it really hard to understand the volatile concept
Thank you Paul. I have gone through this link.

Metaspace is allocated on native memory. What is actually this native memory and how this can be unlimited? Does this mean we will never get outofmemoryerror for metaspace?
No Paul, I understand that they have changed the implementation too but couldn't understand much. I will go through the link you have shared and will buzz you again in case of any queries.
In Java 8, PermGen is replaced with MetaSpace. One advantage discussed is that we no longer get OutOfMemoryError : PermGen but I am just wondering how MetaSpace address this issue because that is also a part of memory and hence, can run out of memory anytime..
6 days ago
At runtime in production. Can we do some kind of logging