Home » Tag Archives: ThreadLocal

Tag Archives: ThreadLocal

Java Nested Transaction using ThreadLocal in POJO

java-logo

Mostly nested transaction was implemented using EJB , now we try to implement the nested transaction on POJO. Here we have used the feature of ThreadLocal. Understanding Nested Transaction Transactions can be nested one inside another.  So the inner transaction or outer transaction can be rollback or commit without affecting the other transaction. When a new transaction is created then ...

Read More »

Understanding the concept behind ThreadLocal

java-interview-questions-answers

Intro I was aware of thread local but never had the occasion of really using it until recently. So I start digging a little bit on the subject because I needed an easy way of propagating some user information via the different layers of my web application without changing the signature of each method called. Small prerequisite info A thread ...

Read More »

Threading stories: ThreadLocal in web applications

java-logo

This week I spend reasonable time to eliminate all our ThreadLocal variables in our web applications. The reason was that they created classloader leaks and we coudn’t undeploy our applications properly anymore. Classloader leaks happen when a GC root keeps referencing an application object after the application was undeployed. If an application object is still referenced after undeploy, then the ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.