Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to overcome 61 Join Problem ?

 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have a huge object graph to retrieve.
I have to keep my loading lazy.
I am facing a 61 Join problem while retrieving data using Criteria and FetchMode.JOIN.

Please suggest how can I overcome this issue.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are trying to join 61 tables? That is a huge amount of data to pull into memory. Why do you need to retrieve it as one object graph?

Is it Hibernate that is preventing you from joining so many tables? Where a databases has a join limit it tends to be far higher than 61.
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul,

I have such a module into which I need to replicate the entire object graph and then need to store it again in database.

So for replication of the same I need to fetch each and every thing of the object graph.

(e.g. In my project, There is a work flow which holds a schedule of activities which almost covers the entire object graph of the project. So I have made a base which I will replicate each time)

So I am looking for best techniques to fetch the entire object graph.

I am trying to load it partly but that seems tedious and in future I have to incorporate changes and that may leads to lot of rework.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhavesh Dak wrote:Thanks Paul,

I have such a module into which I need to replicate the entire object graph and then need to store it again in database.

So for replication of the same I need to fetch each and every thing of the object graph.

(e.g. In my project, There is a work flow which holds a schedule of activities which almost covers the entire object graph of the project. So I have made a base which I will replicate each time)

So I am looking for best techniques to fetch the entire object graph.

I am trying to load it partly but that seems tedious and in future I have to incorporate changes and that may leads to lot of rework.


I think in a scenario of a batch like action, it might be better to create a Stored procedure to do it, If all you are doing is loading it from the database then inserting a copy into the database, then you probably better off using a different tool for that use case.

Mark
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:
I think in a scenario of a batch like action, it might be better to create a Stored procedure to do it, If all you are doing is loading it from the database then inserting a copy into the database, then you probably better off using a different tool for that use case.
Mark



Hi Mark,

Please suggest me if you have in your mind any such tool in hibernate that can be useful for me.

Thanks for way to Stored Procedure I will give it a try, Haven't used yet
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did not find any better solution so finally end up in partial loading of my object graph and then merged altogether.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic