Question: As I understand so far stateless sessions are preferred when using batch processes since It will just detach objects doing the process So that persistent context and cache would be free so batch processes are the idle case for that, It is commonly known as plain JDBC Query Engine with queries translated to SQL queries immediately.
Referenced from : <https://stackoverflow.com/a/14174403/1460591>

On the other hand, I learned that native queries do the same the one difference I see is that the stateless session can map the result to an entity, Native queries don't do that until mapper is explicitly provided.

So is there another difference and from a performance point of view which is better when doing batch processes?

Answer: 
If by batch processing you mean modifying entities in the database server via the SQL query itself (e.g. `UPDATE things SET daily_quota=15`) then the native SQL is faster. However, in this case, you aren't loading any entities so this doesn't really seem to jive with your question.

If by batch processing you mean modifying entities in your program (e.g. load all `Thing` instances, modify the `dailyQuota` attribute to `15` and write an update then you will want a stateless session.

Using a native query to retrieve the objects doesn't give you any mechanism to modify the object. You still need to merge it back to the persistence context and flush those changes. Once you do this (assuming you don't have a stateless session) then it will use the classic change-detecting & cache-keeping flush mechanism.

A stateless session on the other hand gives you a way to modify entities in your program without forcing the ORM layer to go through the slow change detection process.
As always, if it comes to performance, the best thing to do is to measure. Noone can tell which one will be better in your setup, we don't know which DB you are using, which Hibernate version, which OS, etc. Depends on a lot of things.

However, if it comes to performance, the best thing you can do is using native queries. If you can simply put your update logic into a query, do it and execute the query. In this case the DB will handle everything which is the best in terms of performance.

If it's a requirement for you to work with entities, go with stateless session because as you mentioned it gives you the possibility to map the results of a query to entities. Although, there are other differences between going stateless and native queries:

With stateless session you will lose:

* First level caching
* Second level caching
* Any interceptor mechanism, as it's bypassing everything
* Automatic dirty checking
* Cascading

Of course losing these also means performance, but if any of these are important for you, it's better to avoid then.

In case you want to go with a regular session, you can use JDBC batching as well which greatly can improve the performance, but make sure you regularly flush and clear your persistence context to avoid growing your cache.