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!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials