+3  A: 

Well, you have a "consistent" exception:

org.hibernate.InstantiationException: No default constructor for entity: com.expt.hibernate.core.Student

Just add a default constructor on your Student entity (the JPA specification actually mandates a default constructor on mapped classes to make dynamic instantiation of the class possible by the JPA provider).

Update: (answering a comment from the OP)

yeah. i can add a default constructor and get it working but i just wanted JPA-Hibernate to tell me in the very first go not in the second run. Also, i don't really the theme behind it giving the exception during the second run and not in the first run

Honestly, I can't say why it works the first time with JPA/Hibernate and fails directly with Hibernate core (well, obviously, JPA/Hibernate didn't use dynamic instantiation on the first run but I don't know why and, actually, you skipped the interesting parts of the stacktrace :) Anyway, Hibernate and the JPA spec don't mandate exceptions to be thrown at the same time, they mandate you to provide a default constructor on your entities and you didn't. So, I wouldn't spend too much time on on this little behavioral difference as this is an implementation detail. Just build to spec and voilà! And if really you want to know, you have the source code, you have a debugger. Just use them :)

Pascal Thivent
yeah. i can add a default constructor and get it working but i just wanted JPA-Hibernate to tell me in the very first go not in the second run.Also, i don't really the theme behind it giving the exception during the second run and not in the first run.
Jegan
A: 

In both cases you got an error that prevented the operation, which needs the default constructor and we both know that this was the problem and what is the solution.

about the different behavior I can't answer you, you should provide more information about how you are saving the objects in both cases, maybe a session flush, or a transaction not being executed may cause the late appearance of the error using JPA!!

Omar Al Kababji
In both the cases, i have used ----entityManager.persist(studentObj);txion.commit();entityManager.close();----This late apperance of the error using JPA can never be because the txion is executed late coz all am doing is persist a student obj and query the number of students using HQL / JPAQL. Either of them provides me a persistent reference and not a proxy.
Jegan
mmm interesting, may be is just a different behavior between both!!
Omar Al Kababji