Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Persisting linked-list using Hibernate  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the object model attached. Parent has reference to firstSeqChild and then onward the seqChild object keeps the reference to next seqChild, hence creating a linked list.

Hibernate saveOrUpdate fails with StackOverflow exception if the parent has approx 300 transient seqChildren (due to cascade save effect).
Is there anyway to bypass this problem? I am expecting this seqChildren list to be in thousands in actual implementation.

Another obvious thought I had was to convert the parent seqChild relationship to a "one to many" and use sorted set based on a new index column. but that does not server the purpose becuase an object can be inserted in between the chain (linked list). "it is mandatory for every seqChild to know its preceeding and follwoing seqChild". Design changes, that does not contradict this rule are also welcome.

Relevant code ..



Please ask for any additional information required .. Thanks for your help ..
[Thumbnail for Model.jpg]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!