Which features in java.util.concurrent are used in spring & JPA real applications
I'm a java developer, and in the last 4 months i have studied spring,hibernate and JPA.
I've heard that java server side developers that use this frameworks also combining it with java's multi-threading features and the java.util.concurrent package.
I want to ask all of you experienced java server side developers out there: can you give me example when did you use each of the next features:
Thread local.
Creating Thread pools with the Executor service interface.
Callable and Future.
Synchronized keyword.
Volatile keyword.
Lock interface.
Wait and notify.
Condition,signal and await.
Join and sleep.
Fork-Join.
CountDownLatch.
CyclicBarrier.
Semaphores.
Data structures: Synchronized , thread-notification , producer/Consumer.
I will start by answering what i've discovered so far:
hibernate - You don't need to use them if you are working with hibernate because you can use the getCurrentSession() method.
Spring - If you are working with spring and JPA you can write the @PersistenceContext annotation before the reference of the entity manager in the DAO classes, and spring will create a different entity manager for each thread, so you don't need to use thread locals.
Now you guys..(:
I'm a java developer, and in the last 4 months i have studied spring,hibernate and JPA.
I've heard that java server side developers that use this frameworks also combining it with java's multi-threading features and the java.util.concurrent package.
I want to ask all of you experienced java server side developers out there: can you give me example when did you use each of the next features:
Thread local.
Creating Thread pools with the Executor service interface.
Callable and Future.
Synchronized keyword.
Volatile keyword.
Lock interface.
Wait and notify.
Condition,signal and await.
Join and sleep.
Fork-Join.
CountDownLatch.
CyclicBarrier.
Semaphores.
Data structures: Synchronized , thread-notification , producer/Consumer.
I will start by answering what i've discovered so far:
hibernate - You don't need to use them if you are working with hibernate because you can use the getCurrentSession() method.
Spring - If you are working with spring and JPA you can write the @PersistenceContext annotation before the reference of the entity manager in the DAO classes, and spring will create a different entity manager for each thread, so you don't need to use thread locals.
Now you guys..(:
No comments:
Post a Comment