Disclosure: This article may contain affiliate links. When you purchase, we may earn a commission.

Difference between save(), saveOrUpdate() and persist() in Hibernate Session

The Session interface in Hibernate provides a couple of methods to move an object from a new or transient state to a persistent state e.g. save(), saveOrUpdate(), and persist() are used to store an object into the database, but there are some significant differences between them. The method does an INSERT to store the object into the database and it also returns the identifier generated by the database. On the other hand, saveOrUpdate() can be used to reattach a detached object in Hibernate Session i.e. it can do INSERT or UPDATE depending upon whether an object exists in the database or not. 

10 Free Java Programing Books for beginners - download, pdf and HTML

Every Java programmer loves free eBooks on Java, don't you? When I shared my collection of top 10 Java programming books, one of my readers asked me to share some free Java books as well. Doing a quick search on the internet reveals lots of free books, resources, and tutorials to learn Java. I have chosen some of the good Java books, which are FREE, available for download or you can read it online in HTML or PDF format. These books are an excellent resource for any Java beginners, as well as an experienced programmer, and since they are free, it makes absolute sense to have a look on this before buying any other book in Java.

java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener [Solution]

Problem : You are getting java.lang.ClassNotFoundException : org.Springframework.Web.
Context.ContextLoaderListener in your Spring-based Java Web application.
Cause: This error comes when you are using the Spring MVC framework in your Java Web application and configured org.springframework.web.context.ContextLoaderListener as a listener in your deployment descriptor also known as web.xml, but the JAR which contains this class is not available in the web application's CLASSPATH.

Top 20 Hibernate Interview Questions with Answers for Java Programmers

Hibernate is one of the most popular persistent frameworks in the Java world. Hibernate offers an object to relational (ORM) solution which frees Java developers from writing tedious, hard to read, and cluttered JDBC code converting SQL columns into Object properties. Apart from freeing Java developers from writing JDBC and database interaction code, Hibernate also offers the out-of-box solution on caching, proxying, and lazy loading which drastically improves the performance of your Java Web application. Given its importance in the Java Web application development field, Hibernate has become one of the most sought-after skills and goes hand in hand with Spring framework. That's why Spring and Hibernate interview questions are also very popular in Java interviews, particularly for web development positions.

How to test REST API from Command Line using cURL command in Linux

The curl or cURL command of Linux is a compelling and versatile command which allows you to send sophisticated HTTP request right from your Linux command line window. You can use the cURL command to test your RESTful Web Services by sending GET and POST requests, doing authentication, saving a cookie in the file, etc. The curl command is, in fact, the go-to tool for many Java and Spring developers working in web applications and consuming data from the secured RESTful Web Services. Still, you can also use it to test your simple REST Web APIs without security. I have used it many times to check if our Web service is up or not, or is there any error while accessing those services.