Give me some idea/suggest/solution to retrieve data faster and page rendering speed.Technology using Spring MVC - Hibernate - JSP - AngularJS v1.6 - SQL Server Database.Data is retrieved from SQL Server, Mapped to Hibernate Object, While rendering in the User interface getting delayed. Into the project : I am retrieving the Product List(with Product Name, Category,Subcategory, rating, product Image as base64 format and some more details with calculation).
The objective of this post is Rendering data in User Interface is very slow.Is there any way to fine tune the performance of the Web Application.
Sample Code of DAO Layer- Product retrive-Hibernate :
Session session = sessionFactory.openSession(); // Open Session Factory connection
Transaction tx = null; // Transaction
try {
tx = session.beginTransaction(); // Transaction Begin
productMaster = sessionFactory.getCurrentSession()
.createSQLQuery(
"select field1,field2 from Table")
.addScalar("field1", StandardBasicTypes.STRING)
.addScalar("field2", StandardBasicTypes.BIG_INTEGER).list();
for (Object[] o : productMaster) {
map.put(o[0].toString(), Long.parseLong(o[1].toString()));
}
session.getTransaction().commit(); // Transaction Commit once its successful
session.flush(); // Execute all pending statement in DB
session.clear();// Clearing the session object
} catch (HibernateException e) {
if (tx != null) {
tx.rollback();// Unsuccessfull transaction - rollback
}
e.printStackTrace();
} finally {
session.close(); // Closing the connection
}