posted 12 years ago
From what I understand about ThreadLocal, it is used to make a unique instance of a class on a per-thread basis, so it is the opposite of what you want. I usually use queues or pipes to move data between threads. Depending on your setup you could also consider shared variables or just passing it in a setter/constructor. I'd probably use a connection pool, but you seem sold on using the same connection.