• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Named Query Performance

 
pamir sonmez
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, I admit that the question I am asking so broad and you will ask me more detail but I have no more information and I am looking for an idea.

I am using hibernate named query for selecting a list from huge database, in each select I get about 15.000 object on the list.
I am getting list, I am processing it then getting another list, it goes like this multiple times.

The trouble is that the performance of named query increases rapidly.
First 2 sec,then 4 sec, then 6..... and goes

What can I try?

Hibernate settings
Session flushing/clearing
server settings
etc...
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like the issue might memory issue rather than query taking time to retrieve data from database. In case you are using the same session then all the objects will be held in the same session. In my opinion you should consider
Committing changes that you have done (say for each batch of 10000) in case you are making changes to retrieved objects
In case you are not updating then you should consider using clear() or evict() on session
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic