Posts

Showing posts from September, 2020

Uninstall JDK from linux

 https://novicestuffs.wordpress.com/2017/04/25/how-to-uninstall-java-from-linux/

Hibernate and Application Performance

 hibernate 2 cur cache memory var: L1(Level bir) burada entitymanager a aiddir. bazadan gelen entityler cacheda saxlanir ve her entitymanagere xasdir L2(level 2) burada ise umumiyyetle EntityManagerFactory ye xidmet eden entiymanagerler arasinda shared cache memorydir ve level 1 den daha uzun muddetlidir level 2 cache i aktivleshdirmek uchun dependency elave edilir projecte ve 1-2 config edilir Javada 4 cur reference type var : https://dzone.com/articles/reference-types-java-part-1 Strong references. Soft references. Weak references. Phantom references entitymanager de weak referance var , ve o strongla muqayisede GC terefinden istenilen an siline biler ram lazim olsa. soft referance - strongdan zeif , weakdan gucludur ve GC onu ancaq en vacib hallarda sile biler, weak i her memory chatmiyanda sile biler ama softu ancaq outofmemory alacagi teqdirde silib ishlede biler ve soft un omru uzun olur . ve Level 2 cache da istifade edir bunu hibernate. burda da bele shey varki , LRU(last r...

Hibernate Projection approach in project

With using this approach we can get any of field of entity and this way is more efficient rather than get all entity fileds , example in below: @Repository public interface CompanyRepo extends JpaRepository<Company, Long> {     Integer countById(long id);     <T extends CompanyViewProtocol> Optional<T> findById(long id, Class<T> type); } public interface CompanyViewProtocol { } public interface ContactDetailView extends CompanyViewProtocol {     CompanyContactDetail getContactDetail(); } in there companyRepo.findById(1L,ContactDetailView.class)   gives us CompanyContactDetail