Skip to content

Instantly share code, notes, and snippets.

View prashant4224's full-sized avatar
🏠
Working From Home

Prashant Jeerankalagi prashant4224

🏠
Working From Home
View GitHub Profile
/*-----------------Beanfactory vs Application Context
Beanfactory:
Bean instantiating/autowiring
Application Context:
Bean instantiating/autowiring
Automatic BeanPostProcessor registraion
Automatic BeanFactoryPostProcessor registraion
Convenient MessageSource access (i18)
ApplicationEvent publication
Transaction Isolation levels:
Voilations:
Dirty Reads - A updates,B reads, A rollbacks
Non-Repeatable Reads - A reads, B Updates, A reads found 2 records for same.
Phantom Reads - A reads with where critaria, B insert new record which falls in that where critaria, A reads records with same.
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_READ_COMMITTED
TRANSACTION_REPEATABLE_READ
/*--------- Executor Framework -----------*/
java.util.concurrent.Executors
Executor API de-couples execution of tasks from actual task to be executed via Executors
Executor framework to schedule and execute the submitted tasks and return the result from thread pool.
1. Overhead of thread creation & tear-down
2. For each process creating new thread occupy more memory & waste of resources.
ExecutorService executorService = Executors.newSingleThreadExecutor();
ExecutorService executorService = Executors.newFixedThreadPool();