Posts

Showing posts from 2015

JPA Vs SpringJDBC

Recently I conducted many interviews for my employer, one 8-9 yrs exp candidate asked me what data access object layer do we use in our project. I was thinking a bit as , like they do with persistence - polyglot persistence, we maintain different DAO technologies - JPA, proprietary JDBC, JDO, Spring JDBC. you cannot say which one is the best. It depends on the context but definitely having so many things for performing dataaccess is not advisable. In this topic I will try to explore the JPA and Spring JDBC. Spring is a life savior, it's template concept reduces the boilerplate code but still the jdbc template comes with baggages - row mapper, SQL, parameters etc. If you have good knowledge of database schema, you want to execute stored procedure, you want more handle on your code to access the db. Then go for Spring, you can debug easily and have control on your DTO. If you need to abstract away the SQL, hide complexity, write less code, dont need to execute the stored proced...

ElasticSearch multiple strings in multiple fields search

I was working on an ElasticSearch(ES) POC to store millions of database entries to ES and search for multiple strings in multiple fields for all these entries. Let me explain the problem in depth - we use different defect tracking tools such as Rational CharmNT, JIRA and so on, to log defects. In defects we update the exception trace to identify the logs. For example - a stack may look like Exception in thread "main" java . lang . NullPointerException at com . mycompany . myproject . Book . getTitle ( Book . java : 16 ) at com . mycompany . myproject . Author . getBookTitles ( Author . java : 25 )   Similarly another stack may look like Exception in thread "main" java . lang . NullPointerException at com . mycompany . myproject . Course . getSchedule ( Course . java : 162 ) at com . mycompany . myproject . CourseDao . getCourses ( CourseDao. java : 50 )   So, we when a tester sees a NullPointerException he will log the trace t...